git.iko.soy/typeable/pandoc
on master help sign in
Modified README and man page to document lhs features.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1506 788f1e2b-df1e-0410-8736-df70ead52e1b

commit4e122930f130c893bf0e0a31ff09015d10a8140c authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateTue 2 Dec 2008, 22:43 (18 years ago) parent22741eb
2 files changed+56−31
README+51−16 man/man1/pandoc.1.md+5−15
README+51−16
@@ -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+
man/man1/pandoc.1.md+5−15
@@ -64,6 +64,8 @@ to Pandoc. Or use `html2markdown`(1), a wrapper around `pandoc`.
6464: Specify input format. *FORMAT* can be
6565 `native` (native Haskell), `markdown` (markdown or plain text),
6666 `rst` (reStructuredText), `html` (HTML), or `latex` (LaTeX).
67+ If `+lhs` is appended to `markdown`, `rst`, or `latex`, the input
68+ will be treated as literate Haskell source.
6769
6870-t *FORMAT*, -w *FORMAT*, \--to=*FORMAT*, \--write=*FORMAT*
6971: Specify output format. *FORMAT* can be `native` (native Haskell),
@@ -74,7 +76,9 @@ to Pandoc. Or use `html2markdown`(1), a wrapper around `pandoc`.
7476 `odt` (OpenOffice text document), `s5` (S5 HTML and javascript slide
7577 show), or `rtf` (rich text format). Note that `odt` output will not
7678 be directed to *stdout*; an output filename must be specified using
77− the `-o/--output` option.
79+ the `-o/--output` option. If `+lhs` is appended to `markdown`,
80+ `rst`, `latex`, or `html`, the output will be rendered as literate
81+ Haskell source.
7882
7983-s, \--standalone
8084: Produce output with an appropriate header and footer (e.g. a
@@ -142,20 +146,6 @@ to Pandoc. Or use `html2markdown`(1), a wrapper around `pandoc`.
142146 are omitted. URIs in links and images are also checked against a
143147 whitelist of URI schemes.
144148
145−\--lhs-in
146−: Treat input as literate Haskell. In markdown input, "bird track"
147− sections will be treated as Haskell source code. In LaTeX input,
148− `code` environments will be treated as Haskell source code.
149−
150−\--lhs-out
151−: Write output as literate Haskell. In markdown output, Haskell
152− source code will be printed with "bird tracks." In LaTeX output,
153− it will be put in `code` environments. In HTML output, it will
154− be put inside `<pre>` tags, with "bird tracks."
155−
156−\--lhs
157−: Equivalent to `--lhs-in --lhs-out`.
158−
159149\--toc, \--table-of-contents
160150: Include an automatically generated table of contents (HTML, markdown,
161151 RTF) or an instruction to create one (LaTeX, reStructuredText).