@@ -222,13 +222,17 @@ For further documentation, see the `pandoc(1)` man page.
222`-f`, `--from`, `-r`, or `--read` *format*
222`-f`, `--from`, `-r`, or `--read` *format*
223: specifies the input format (the format Pandoc will be converting
223: specifies the input format (the format Pandoc will be converting
224 *from*). *format* can be `native`, `markdown`, `rst`, `html`, or
224 *from*). *format* can be `native`, `markdown`, `rst`, `html`, or
225− `latex`.
225+ `latex`. (`+lhs` can be appended to indicate that the input should
226+ be treated as literate Haskell source. See
227+ [Literate Haskell support](#literate-haskell-support), below.)
227`-t`, `--to`, `-w`, or `--write` *format*
229`-t`, `--to`, `-w`, or `--write` *format*
228: specifies the output format -- the format Pandoc will
230: specifies the output format -- the format Pandoc will
229 be converting *to*. *format* can be `native`, `html`, `s5`,
231 be converting *to*. *format* can be `native`, `html`, `s5`,
230 `docbook`, `opendocument`, `latex`, `context`, `markdown`, `man`,
232 `docbook`, `opendocument`, `latex`, `context`, `markdown`, `man`,
231− `rst`, and `rtf`.
233+ `rst`, and `rtf`. (`+lhs` can be appended to indicate that the
234+ output should be treated as literate Haskell source. See
235+ [Literate Haskell support](#literate-haskell-support), below.)
233`-s` or `--standalone`
237`-s` or `--standalone`
234: indicates that a standalone document is to be produced (with
238: indicates that a standalone document is to be produced (with
@@ -371,20 +375,6 @@ For further documentation, see the `pandoc(1)` man page.
371 are omitted. URIs in links and images are also checked against a
375 are omitted. URIs in links and images are also checked against a
372 whitelist of URI schemes.
376 whitelist of URI schemes.
375−: treat input as literate Haskell. In markdown input, "bird track"
376− sections will be treated as Haskell source code. In LaTeX input,
377− `code` environments will be treated as Haskell source code.
380−: write output as literate Haskell. In markdown output, Haskell
381− source code will be printed with "bird tracks." In LaTeX output,
382− it will be put in `code` environments. In HTML output, it will
383− be put inside `<pre>` tags, with "bird tracks."
386−: equivalent to `--lhs-in --lhs-out`.
388`--dump-args`
378`--dump-args`
389: is intended to make it easier to create wrapper scripts that use
379: is intended to make it easier to create wrapper scripts that use
390 Pandoc. It causes Pandoc to dump information about the arguments
380 Pandoc. It causes Pandoc to dump information about the arguments
@@ -1073,3 +1063,48 @@ and CSS files required by S5. (See the instructions on the S5 website.)
1073Alternatively, you may use `-s` together with the `-H/--custom-header`
1063Alternatively, you may use `-s` together with the `-H/--custom-header`
1066+Literate Haskell support
1067+========================
1069+If you append `+lhs` to an appropriate input or output format (`markdown`,
1070+`rst`, or `latex` for input or output; `html` for output only), pandoc
1071+will treat the document as literate Haskell source. This means that
1073+ - In markdown input, "bird track" sections will be parsed as Haskell
1074+ code rather than block quotations. Text between `\begin{code}`
1075+ and `\end{code}` will also be treated as Haskell code.
1077+ - In markdown output, code blocks with class `haskell` will be
1078+ rendered using bird tracks, and block quotations will be
1079+ indented one space, so they will not be treated as Haskell code.
1080+ In addition, headers will be rendered setext-style (with underlines)
1081+ rather than atx-style (with '#' characters). (This is because ghc
1082+ treats '#' characters in column 1 as introducing line numbers.)
1084+ - In restructured text input, "bird track" sections will be parsed
1087+ - In restructured text output, code blocks with class `haskell` will
1088+ be rendered using bird tracks.
1090+ - In LaTeX input, text in `code` environments will be parsed as
1093+ - In LaTeX output, code blocks with class `haskell` will be rendered
1094+ inside `code` environments.
1096+ - In HTML output, code blocks with class `haskell` will be rendered
1097+ with class `literatehaskell` and bird tracks.
1101+ pandoc -f markdown+lhs -t html
1103+reads literate Haskell source formatted with markdown conventions and writes
1104+ordinary HTML (without bird tracks).
1106+ pandoc -f markdown+lhs -t html+lhs
1108+writes HTML with the Haskell code in bird tracks, so it can be copied
1109+and pasted as literate Haskell source.