Re: [Haskell] ANN: pandoc 1.2

2009-03-05 Thread Sebastian Fischer


On Mar 1, 2009, at 8:21 PM, John MacFarlane wrote:


I'm pleased to announce the release of pandoc version 1.2
(uploaded today to HackageDB).

The most significant new feature is support for literate Haskell.


That is a very useful feature. It let's us mash-up pandoc and lhs2TeX  
to create nicely formatted PDFs from literate Haskell formatted as  
markdown:


pandoc --to=latex+lhs --custom-header=header.tex program.lhs |\
lhs2TeX --output=program && pdflatex program

The file header.tex must contain an appropriate document style and the  
line


%include lhs2TeX.fmt

A slight drawback is that code written indented or between ~~~ (and  
hence not meant to be executed) is converted to a `verbatim`  
environment. As a consequence, lhs2TeX does not use the same  
formatting as in code blocks. To fix this we can insert this in the  
pipe:


sed s/\\begin{verbatim}/\\begin{spec}/ |\
sed s/\\end{verbatim}/\\end{spec}/

but of course this is hack, that does not work, if we want to write  
the replaced strings somewhere in our document..


Unfortunately, I did not manage to use the citeproc extension to get  
references in the text and a bibliography at the end of the latex  
file, thus need to resort to \cite{...} in the source code and bibtex.


Nevertheless, a very useful tool!

Cheers,
Sebastian

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANN: pandoc 1.2

2009-03-01 Thread John MacFarlane
I'm pleased to announce the release of pandoc version 1.2
(uploaded today to HackageDB).

The most significant new feature is support for literate Haskell.
You can now use pandoc directly on literate Haskell source files
to produce syntax-highlighted HTML output:

pandoc -s MyProg.lhs > MyProg.html

Pandoc will interpret text sections as (extended) markdown.  If
you prefer to write literate Haskell using reStructuredText
or LaTeX, pandoc supports that too:

pandoc -s --from rst+lhs MyProg.lhs > MyProg.html
pandoc -s --from latex+lhs MyProg.lhs > MyProg.html

You can even convert from one style to another:

pandoc -s --from markdown+lhs --to latex+lhs MyProg.hs

This release also adds an '--email-obfuscation' option, so
the user can select an email obfuscation method (or disable
obfuscation), and support for citations using the latest version
of Andrea Rossato's citeproc-hs.

In addition, many bugs have been fixed.  Thanks to everyone
who filed bug reports.

John

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell