git.iko.soy/typeable/pandoc
on master help sign in
Documented EPUB writer and --epub-{stylesheet,metadata} options.
commit162b869aacb1c1334fdf8921b7bb77d17dea3bea authorJohn MacFarlane <jgm@berkeley.edu> dateSun 4 Jul 2010, 23:09 (16 years ago) parentefd7167
2 files changed+58−15
README+29−6 man/man1/pandoc.1.md+29−9
README+29−6
@@ -7,7 +7,7 @@ another, and a command-line tool that uses this library. It can read
77[markdown] and (subsets of) [reStructuredText], [HTML], and [LaTeX]; and
88it can write plain text, [markdown], [reStructuredText], [HTML], [LaTeX],
99[ConTeXt], [RTF], [DocBook XML], [OpenDocument XML], [ODT], [GNU Texinfo],
10−[MediaWiki markup], [groff man] pages, and [S5] HTML slide shows.
10+[MediaWiki markup], [EPUB], [groff man] pages, and [S5] HTML slide shows.
1111Pandoc's enhanced version of markdown includes syntax for footnotes,
1212tables, flexible ordered lists, definition lists, delimited code blocks,
1313superscript, subscript, strikeout, title blocks, automatic tables of
@@ -36,6 +36,7 @@ or output format requires only adding a reader or writer.
3636[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
3737[Haskell]: http://www.haskell.org/
3838[GNU Texinfo]: http://www.gnu.org/software/texinfo/
39+[EPUB]: http://www.idpf.org/
3940
4041© 2006-2010 John MacFarlane (jgm at berkeley dot edu). Released under the
4142[GPL], version 2 or greater. This software carries no warranty of
@@ -56,8 +57,8 @@ If you want to write to a file, use the `-o` option:
5657
5758 pandoc -o hello.html hello.txt
5859
59−[^1]: The exception is for `odt`. Since this is a binary output format,
60− an output file must be specified explicitly.
60+[^1]: The exceptions are for `odt` and `epub`. Since these are
61+ a binary output formats, an output file must be specified explicitly.
6162
6263Note that you can specify multiple input files on the command line.
6364`pandoc` will concatenate them all (with blank lines between them)
@@ -90,7 +91,8 @@ Supported output formats include `markdown`, `latex`, `context`
9091(ConTeXt), `html`, `rtf` (rich text format), `rst`
9192(reStructuredText), `docbook` (DocBook XML), `opendocument`
9293(OpenDocument XML), `odt` (OpenOffice text document), `texinfo`, (GNU
93−Texinfo), `mediawiki` (MediaWiki markup), `man` (groff man), and `s5`
94+Texinfo), `mediawiki` (MediaWiki markup), `epub` (EPUB ebook),
95+`man` (groff man), and `s5`
9496(which produces an HTML file that acts like powerpoint).
9597
9698Supported input formats include `markdown`, `html`, `latex`, and `rst`.
@@ -202,8 +204,8 @@ For further documentation, see the `pandoc(1)` man page.
202204`-o` or `--output` *filename*
203205: sends output to *filename*. If this option is not specified,
204206 or if its argument is `-`, output will be sent to stdout.
205− (Exception: if the output format is `odt`, output to stdout
206− is disabled.)
207+ (Exception: if the output format is `odt` or `epub`, output to
208+ stdout is disabled.)
207209
208210`-p` or `--preserve-tabs`
209211: causes tabs in the source text to be preserved, rather than converted
@@ -297,6 +299,26 @@ For further documentation, see the `pandoc(1)` man page.
297299 `--data-dir`, below). If it is not found there, sensible defaults
298300 will be used.
299301
302+`--epub-stylesheet` *filename*
303+: uses the specified CSS file to style the EPUB. If no stylesheet
304+ is specified, pandoc will look for a file `epub.css` in the
305+ user data directory (see `--data-dir`, below). If it is not
306+ found there, sensible defaults will be used.
307+
308+`--epub-metadata` *filename*
309+: looks in the specified XML file for metadata for the EPUB.
310+ The file should contain a series of [Dublin Core elements],
311+ for example:
312+
313+ <dc:rights>Creative Commons</dc:rights>
314+ <dc:language>es-AR</dc:language>
315+
316+ By default, pandoc will include the following metadata elements:
317+ `<dc:title>` (from the document title), `<dc:creator>` (from the
318+ document authors), `<dc:language>` (from the locale), and
319+ `<dc:identifier id="BookId">` (a randomly generated UUID). Any of
320+ these may be overridden by elements in the metadata file.
321+
300322`-D` or `--print-default-template` *format*
301323: prints the default template for an output *format*. (See `-t`
302324 for a list of possible *format*s.)
@@ -445,6 +467,7 @@ For further documentation, see the `pandoc(1)` man page.
445467[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
446468[gladTeX]: http://www.math.uio.no/~martingu/gladtex/index.html
447469[mimeTeX]: http://www.forkosh.com/mimetex.html
470+[Dublin Core elements]: http://dublincore.org/documents/dces/
448471
449472Templates
450473=========
man/man1/pandoc.1.md+29−9
@@ -16,13 +16,13 @@ Pandoc converts files from one markup format to another. It can
1616read markdown and (subsets of) reStructuredText, HTML, and LaTeX, and
1717it can write plain text, markdown, reStructuredText, HTML, LaTeX,
1818ConTeXt, Texinfo, groff man, MediaWiki markup, RTF, OpenDocument XML,
19−ODT, DocBook XML, and S5 HTML slide shows.
19+ODT, DocBook XML, EPUB, and S5 HTML slide shows.
2020
2121If no *input-file* is specified, input is read from *stdin*.
2222Otherwise, the *input-files* are concatenated (with a blank
2323line between each) and used as input. Output goes to *stdout* by
24−default (though output to *stdout* is disabled for the `odt` output
25−format). For output to a file, use the `-o` option:
24+default (though output to *stdout* is disabled for the `odt` and
25+`epub` output formats). For output to a file, use the `-o` option:
2626
2727 pandoc -o output.html input.txt
2828
@@ -74,12 +74,12 @@ should pipe input and output through `iconv`:
7474 `html` (HTML), `latex` (LaTeX), `context` (ConTeXt), `man` (groff man),
7575 `mediawiki` (MediaWiki markup), `texinfo` (GNU Texinfo),
7676 `docbook` (DocBook XML), `opendocument` (OpenDocument XML),
77− `odt` (OpenOffice text document), `s5` (S5 HTML and javascript slide
78− show), or `rtf` (rich text format). Note that `odt` output will not
79− be directed to *stdout*; an output filename must be specified using
80− the `-o/--output` option. If `+lhs` is appended to `markdown`,
81− `rst`, `latex`, or `html`, the output will be rendered as literate
82− Haskell source.
77+ `odt` (OpenOffice text document), `epub` (EPUB book),
78+ `s5` (S5 HTML and javascript slide show), or `rtf` (rich text
79+ format). Note that `odt` and `epub` output will not be directed to
80+ *stdout*; an output filename must be specified using the `-o/--output`
81+ option. If `+lhs` is appended to `markdown`, `rst`, `latex`, or `html`,
82+ the output will be rendered as literate Haskell source.
8383
8484-s, \--standalone
8585: Produce output with an appropriate header and footer (e.g. a
@@ -221,6 +221,26 @@ should pipe input and output through `iconv`:
221221 `--data-dir`). If this is not found either, sensible defaults will be
222222 used.
223223
224+\--epub-stylesheet=*filename*
225+: Use the specified CSS file to style the EPUB. If no stylesheet
226+ is specified, pandoc will look for a file `epub.css` in the
227+ user data directory (see `--data-dir`, below). If it is not
228+ found there, sensible defaults will be used.
229+
230+\--epub-metadata=*filename*
231+: Look in the specified XML file for metadata for the EPUB.
232+ The file should contain a series of Dublin Core elements
233+ (http://dublincore.org/documents/dces/), for example:
234+
235+ <dc:rights>Creative Commons</dc:rights>
236+ <dc:language>es-AR</dc:language>
237+
238+ By default, pandoc will include the following metadata elements:
239+ `<dc:title>` (from the document title), `<dc:creator>` (from the
240+ document authors), `<dc:language>` (from the locale), and
241+ `<dc:identifier id="BookId">` (a randomly generated UUID). Any of
242+ these may be overridden by elements in the metadata file.
243+
224244-D *FORMAT*, \--print-default-template=*FORMAT*
225245: Print the default template for an output *FORMAT*. (See `-t`
226246 for a list of possible *FORMAT*s.)