git.iko.soy/typeable/pandoc
on master help sign in
README: Documented man page writer, special title-line
b106e51fiddlosopher
README+33−21
@@ -6,8 +6,9 @@ Pandoc is a [Haskell] library for converting from one markup format
6to another, and a command-line tool that uses this library. It can read
6to another, and a command-line tool that uses this library. It can read
7[markdown] and (subsets of) [reStructuredText], [HTML], and [LaTeX],
7[markdown] and (subsets of) [reStructuredText], [HTML], and [LaTeX],
8and it can write [markdown], [reStructuredText], [HTML], [LaTeX], [RTF],
8and it can write [markdown], [reStructuredText], [HTML], [LaTeX], [RTF],
9−[DocBook XML], and [S5] HTML slide shows. Pandoc's version of markdown
9+[DocBook XML], [groff man] pages, and [S5] HTML slide shows. Pandoc's
10−contains some enhancements, like footnotes and embedded LaTeX.
10+version of markdown contains some enhancements, like footnotes and
11+embedded LaTeX.
11
12
12In contrast to existing tools for converting markdown to HTML, which
13In contrast to existing tools for converting markdown to HTML, which
13use regex substitutions, Pandoc has a modular design: it consists of a
14use regex substitutions, Pandoc has a modular design: it consists of a
@@ -23,6 +24,7 @@ or output format requires only adding a reader or writer.
23[LaTeX]: http://www.latex-project.org/
24[LaTeX]: http://www.latex-project.org/
24[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
25[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
25[DocBook XML]: http://www.docbook.org/
26[DocBook XML]: http://www.docbook.org/
27+[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
26[Haskell]: http://www.haskell.org/
28[Haskell]: http://www.haskell.org/
27
29
28(c) 2006 John MacFarlane (jgm at berkeley dot edu). Released under the
30(c) 2006 John MacFarlane (jgm at berkeley dot edu). Released under the
@@ -110,16 +112,17 @@ To convert `hello.html` from html to markdown:
110
112
111Supported output formats include `markdown`, `latex`, `html`, `rtf`
113Supported output formats include `markdown`, `latex`, `html`, `rtf`
112(rich text format), `rst` (reStructuredText), `docbook` (DocBook
114(rich text format), `rst` (reStructuredText), `docbook` (DocBook
113−XML), and `s5` (which produces an HTML file that acts like powerpoint).
115+XML), `man` (groff man), and `s5` (which produces an HTML file that
114−Supported input formats include `markdown`, `html`, `latex`, and `rst`.
116+acts like powerpoint). Supported input formats include `markdown`,
115−Note that the `rst` reader only parses a subset of reStructuredText
117+`html`, `latex`, and `rst`. Note that the `rst` reader only parses
116−syntax. For example, it doesn't handle tables, definition lists, option
118+a subset of reStructuredText syntax. For example, it doesn't handle
117−lists, or footnotes. It handles only the constructs expressible in
119+tables, definition lists, option lists, or footnotes. It handles only
118−unextended markdown. But for simple documents it should be adequate.
120+the constructs expressible in unextended markdown. But for simple
119−The `latex` and `html` readers are also limited in what they can do.
121+documents it should be adequate. The `latex` and `html` readers are also
120−Because the `html` reader is picky about the HTML it parses, it is
122+limited in what they can do. Because the `html` reader is picky about
121−recommended that you pipe HTML through [HTML Tidy] before sending it to
123+the HTML it parses, it is recommended that you pipe HTML through [HTML
122−`pandoc`, or use the `html2markdown` script described below.
124+Tidy] before sending it to `pandoc`, or use the `html2markdown` script
125+described below.
123
126
124If you don't specify a reader or writer explicitly, `pandoc` will
127If you don't specify a reader or writer explicitly, `pandoc` will
125try to determine the input and output format from the extensions of
128try to determine the input and output format from the extensions of
@@ -137,11 +140,10 @@ be assumed to be markdown unless explicitly specified.
137Character encodings
140Character encodings
138-------------------
141-------------------
139
142
140−Unfortunately, due to limitations in GHC, `pandoc` does not automatically
141−detect the system's local character encoding. Hence, all input and
142−output is assumed to be in the UTF-8 encoding. If your local character
143+All input is assumed to be in the UTF-8 encoding, and all output
144+is in UTF-8. If your local character encoding is not UTF-8 and you use
143−encoding is not UTF-8 and you use accented or foreign characters,
145+accented or foreign characters, you should pipe the input and output
144−you should pipe the input and output through [`iconv`]. For example,
146+through [`iconv`]. For example,
145
147
146 iconv -t utf-8 source.txt | pandoc | iconv -f utf-8 > output.html
148 iconv -t utf-8 source.txt | pandoc | iconv -f utf-8 > output.html
147
149
@@ -652,11 +654,21 @@ window in a browser -- and once at the beginning of the document body.
652The title in the document head can have an optional prefix attached
654The title in the document head can have an optional prefix attached
653(`--title-prefix` or `-T` option). The title in the body appears as
655(`--title-prefix` or `-T` option). The title in the body appears as
654an H1 element with class "title", so it can be suppressed or
656an H1 element with class "title", so it can be suppressed or
655−reformatted with CSS.
657+reformatted with CSS. If a title prefix is specified with `-T` and no
658+title block appears in the document, the title prefix will be used by
659+itself as the HTML title.
656
660
657−If a title prefix is specified with `-T` and no title block appears
661+The man page writer extracts a title, man page section number, and
658−in the document, the title prefix will be used by itself as the
662+other header and footer information from the title line. These should
659−HTML title.
663+be separated by pipe characters (`|`), as follows:
664+
665+ % title | section number (1-9) | footer left | header center
666+
667+For example,
668+
669+ % pandoc | 1 | Pandoc User Manuals | Version 4.0
670+
671+The middle of the man page footer is used for the date.
660
672
661Box-style blockquotes
673Box-style blockquotes
662---------------------
674---------------------