@@ -222,13 +222,17 @@ For further documentation, see the `pandoc(1)` man page.
222222`-f`, `--from`, `-r`, or `--read` *format*
223223: specifies the input format (the format Pandoc will be converting
224224 *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.)
226228
227229`-t`, `--to`, `-w`, or `--write` *format*
228230: specifies the output format -- the format Pandoc will
229231 be converting *to*. *format* can be `native`, `html`, `s5`,
230232 `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.)
232236
233237`-s` or `--standalone`
234238: indicates that a standalone document is to be produced (with
@@ -371,20 +375,6 @@ For further documentation, see the `pandoc(1)` man page.
371375 are omitted. URIs in links and images are also checked against a
372376 whitelist of URI schemes.
373377
374−`--lhs-in`
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.
378−
379−`--lhs-out`
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."
384−
385−`--lhs`
386−: equivalent to `--lhs-in --lhs-out`.
387−
388378`--dump-args`
389379: is intended to make it easier to create wrapper scripts that use
390380 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.)
10731063Alternatively, you may use `-s` together with the `-H/--custom-header`
10741064option.
10751065
1066+Literate Haskell support
1067+========================
1068+
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
1072+
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.
1076+
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.)
1083+
1084+ - In restructured text input, "bird track" sections will be parsed
1085+ as Haskell code.
1086+
1087+ - In restructured text output, code blocks with class `haskell` will
1088+ be rendered using bird tracks.
1089+
1090+ - In LaTeX input, text in `code` environments will be parsed as
1091+ Haskell code.
1092+
1093+ - In LaTeX output, code blocks with class `haskell` will be rendered
1094+ inside `code` environments.
1095+
1096+ - In HTML output, code blocks with class `haskell` will be rendered
1097+ with class `literatehaskell` and bird tracks.
1098+
1099+Examples:
1100+
1101+ pandoc -f markdown+lhs -t html
1102+
1103+reads literate Haskell source formatted with markdown conventions and writes
1104+ordinary HTML (without bird tracks).
1105+
1106+ pandoc -f markdown+lhs -t html+lhs
1107+
1108+writes HTML with the Haskell code in bird tracks, so it can be copied
1109+and pasted as literate Haskell source.
1110+