2007-07-21 22:36:08 +02:00
|
|
|
% PANDOC(1) Pandoc User Manuals
|
2007-07-02 01:26:20 +02:00
|
|
|
% John MacFarlane
|
2008-01-08 18:25:57 +01:00
|
|
|
% January 8, 2008
|
2007-07-02 01:26:20 +02:00
|
|
|
|
|
|
|
# NAME
|
|
|
|
|
|
|
|
pandoc - general markup converter
|
|
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
|
2007-07-02 04:16:58 +02:00
|
|
|
pandoc [*options*] [*input-file*]...
|
2007-07-02 01:26:20 +02:00
|
|
|
|
|
|
|
# DESCRIPTION
|
|
|
|
|
|
|
|
Pandoc converts files from one markup format to another. It can
|
|
|
|
read markdown and (subsets of) reStructuredText, HTML, and LaTeX, and
|
2008-02-24 06:48:59 +01:00
|
|
|
it can write markdown, reStructuredText, HTML, LaTeX, ConTeXt, Texinfo,
|
2008-08-02 19:56:09 +02:00
|
|
|
groff man, MediaWiki markup, RTF, OpenDocument XML, ODT, DocBook XML,
|
2008-07-27 05:25:51 +02:00
|
|
|
and S5 HTML slide shows.
|
2007-07-02 01:26:20 +02:00
|
|
|
|
2008-08-11 00:24:43 +02:00
|
|
|
If no *input-file* is specified, input is read from *stdin*.
|
2007-07-02 01:26:20 +02:00
|
|
|
Otherwise, the *input-files* are concatenated (with a blank
|
2008-08-11 00:24:43 +02:00
|
|
|
line between each) and used as input. Output goes to *stdout* by
|
|
|
|
default (though output to *stdout* is disabled for the `odt` output
|
2008-08-02 19:56:09 +02:00
|
|
|
format). For output to a file, use the `-o` option:
|
2007-07-02 01:26:20 +02:00
|
|
|
|
|
|
|
pandoc -o output.html input.txt
|
|
|
|
|
|
|
|
The input and output formats may be specified using command-line options
|
|
|
|
(see **OPTIONS**, below, for details). If these formats are not
|
|
|
|
specified explicitly, Pandoc will attempt to determine them
|
|
|
|
from the extensions of the input and output filenames. If input comes
|
2008-08-11 00:24:43 +02:00
|
|
|
from *stdin* or from a file with an unknown extension, the input is assumed
|
2007-07-02 01:26:20 +02:00
|
|
|
to be markdown. If no output filename is specified using the `-o`
|
|
|
|
option, or if a filename is specified but its extension is unknown,
|
|
|
|
the output will default to HTML. Thus, for example,
|
|
|
|
|
|
|
|
pandoc -o chap1.tex chap1.txt
|
|
|
|
|
|
|
|
converts *chap1.txt* from markdown to LaTeX. And
|
|
|
|
|
|
|
|
pandoc README
|
|
|
|
|
|
|
|
converts *README* from markdown to HTML.
|
|
|
|
|
|
|
|
Pandoc's version of markdown is an extended variant of standard
|
|
|
|
markdown: the differences are described in the *README* file in
|
|
|
|
the user documentation. If standard markdown syntax is desired, the
|
|
|
|
`--strict` option may be used.
|
|
|
|
|
|
|
|
Pandoc uses the UTF-8 character encoding for both input and output.
|
|
|
|
If your local character encoding is not UTF-8, you should pipe input
|
|
|
|
and output through `iconv`:
|
|
|
|
|
|
|
|
iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
|
|
|
|
|
|
|
|
Pandoc's HTML parser is not very forgiving. If your input is
|
|
|
|
HTML, consider running it through `tidy`(1) before passing it
|
|
|
|
to Pandoc. Or use `html2markdown`(1), a wrapper around `pandoc`.
|
|
|
|
|
|
|
|
# OPTIONS
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-f *FORMAT*, -r *FORMAT*, \--from=*FORMAT*, \--read=*FORMAT*
|
2007-07-02 01:26:20 +02:00
|
|
|
: Specify input format. *FORMAT* can be
|
|
|
|
`native` (native Haskell), `markdown` (markdown or plain text),
|
|
|
|
`rst` (reStructuredText), `html` (HTML), or `latex` (LaTeX).
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-t *FORMAT*, -w *FORMAT*, \--to=*FORMAT*, \--write=*FORMAT*
|
2007-07-02 01:26:20 +02:00
|
|
|
: Specify output format. *FORMAT* can be `native` (native Haskell),
|
|
|
|
`markdown` (markdown or plain text), `rst` (reStructuredText),
|
2007-07-15 05:17:33 +02:00
|
|
|
`html` (HTML), `latex` (LaTeX), `context` (ConTeXt), `man` (groff man),
|
2008-07-27 05:25:51 +02:00
|
|
|
`mediawiki` (MediaWiki markup), `texinfo` (GNU Texinfo),
|
|
|
|
`docbook` (DocBook XML), `opendocument` (OpenDocument XML),
|
2008-08-02 19:56:09 +02:00
|
|
|
`odt` (OpenOffice text document), `s5` (S5 HTML and javascript slide
|
2008-08-11 00:24:43 +02:00
|
|
|
show), `pdf` (Portable Document Format), or `rtf` (rich text
|
|
|
|
format). Note that for `odt` and `pdf` output, output will not be
|
|
|
|
directed to *stdout*; an output filename must be specified using the
|
|
|
|
`-o/--output` option.
|
2007-07-02 01:26:20 +02:00
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-s, \--standalone
|
2007-07-02 01:26:20 +02:00
|
|
|
: Produce output with an appropriate header and footer (e.g. a
|
|
|
|
standalone HTML, LaTeX, or RTF file, not a fragment).
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-o *FILE*, \--output=*FILE*
|
2008-08-11 00:24:43 +02:00
|
|
|
: Write output to *FILE* instead of *stdout*. If *FILE* is
|
|
|
|
\``-`', output will go to *stdout*.
|
2007-07-02 01:26:20 +02:00
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-p, \--preserve-tabs
|
2007-07-02 01:26:20 +02:00
|
|
|
: Preserve tabs instead of converting them to spaces.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
\--tab-stop=*TABSTOP*
|
2007-07-02 01:26:20 +02:00
|
|
|
: Specify tab stop (default is 4).
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
\--strict
|
2007-07-02 01:26:20 +02:00
|
|
|
: Use strict markdown syntax, with no extensions or variants.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
\--reference-links
|
2007-07-02 01:26:20 +02:00
|
|
|
: Use reference-style links, rather than inline links, in writing markdown
|
|
|
|
or reStructuredText.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-R, \--parse-raw
|
2007-07-02 01:26:20 +02:00
|
|
|
: Parse untranslatable HTML codes and LaTeX environments as raw HTML
|
|
|
|
or LaTeX, instead of ignoring them.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-S, \--smart
|
2007-07-02 01:26:20 +02:00
|
|
|
: Use smart quotes, dashes, and ellipses. (This option is significant
|
|
|
|
only when the input format is `markdown`. It is selected automatically
|
2007-07-15 05:17:33 +02:00
|
|
|
when the output format is `latex` or `context`.)
|
2007-07-02 01:26:20 +02:00
|
|
|
|
2008-08-13 05:02:42 +02:00
|
|
|
-m*URL*, \--latexmathml=*URL*
|
|
|
|
: Use LaTeXMathML to display embedded TeX math in HTML output.
|
|
|
|
To insert a link to a local copy of the `LaTeXMathML.js` script,
|
2007-07-26 04:40:18 +02:00
|
|
|
provide a *URL*. If no *URL* is provided, the contents of the
|
|
|
|
script will be inserted directly into the HTML header.
|
2007-07-02 01:26:20 +02:00
|
|
|
|
2007-12-01 04:11:47 +01:00
|
|
|
\--gladtex
|
|
|
|
: Enclose TeX math in `<eq>` tags in HTML output. These can then
|
|
|
|
be processed by gladTeX to produce links to images of the typeset
|
|
|
|
formulas.
|
|
|
|
|
|
|
|
\--mimetex=*URL*
|
|
|
|
: Render TeX math using the mimeTeX CGI script. If *URL* is not specified,
|
|
|
|
it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-i, \--incremental
|
2007-07-02 01:26:20 +02:00
|
|
|
: Make list items in S5 display incrementally (one by one).
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-N, \--number-sections
|
2007-07-02 01:26:20 +02:00
|
|
|
: Number section headings in LaTeX output. (Default is not to number
|
|
|
|
them.)
|
|
|
|
|
2007-09-27 03:28:28 +02:00
|
|
|
\--no-wrap
|
2007-11-15 04:23:02 +01:00
|
|
|
: Disable text wrapping in output. (Default is to wrap text.)
|
2007-09-27 03:28:28 +02:00
|
|
|
|
2008-01-03 22:32:32 +01:00
|
|
|
\--sanitize-html
|
|
|
|
: Sanitizes HTML (in markdown or HTML input) using a whitelist.
|
|
|
|
Unsafe tags are replaced by HTML comments; unsafe attributes
|
2008-03-22 21:41:56 +01:00
|
|
|
are omitted. URIs in links and images are also checked against a
|
|
|
|
whitelist of URI schemes.
|
2008-01-03 22:32:32 +01:00
|
|
|
|
2007-07-12 05:45:00 +02:00
|
|
|
\--toc, \--table-of-contents
|
|
|
|
: Include an automatically generated table of contents (HTML, markdown,
|
|
|
|
RTF) or an instruction to create one (LaTeX, reStructuredText).
|
|
|
|
This option has no effect on man, DocBook, or S5 output.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-c *CSS*, \--css=*CSS*
|
2007-07-02 01:26:20 +02:00
|
|
|
: Link to a CSS style sheet. *CSS* is the pathname of the style sheet.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-H *FILE*, \--include-in-header=*FILE*
|
2007-07-02 01:26:20 +02:00
|
|
|
: Include contents of *FILE* at the end of the header. Implies `-s`.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-B *FILE*, \--include-before-body=*FILE*
|
2007-07-02 01:26:20 +02:00
|
|
|
: Include contents of *FILE* at the beginning of the document body.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-A *FILE*, \--include-after-body=*FILE*
|
2007-07-02 01:26:20 +02:00
|
|
|
: Include contents of *FILE* at the end of the document body.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-C *FILE*, \--custom-header=*FILE*
|
2007-07-02 01:26:20 +02:00
|
|
|
: Use contents of *FILE* as the document header (overriding the
|
|
|
|
default header, which can be printed by using the `-D` option).
|
|
|
|
Implies `-s`.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-D *FORMAT*, \--print-default-header=*FORMAT*
|
2007-07-02 01:26:20 +02:00
|
|
|
: Print the default header for *FORMAT* (`html`, `s5`, `latex`,
|
2008-07-26 23:29:09 +02:00
|
|
|
`context`, `docbook`, `man`, `markdown`, `opendocument`,
|
|
|
|
`rst`, `rtf`).
|
2007-07-02 01:26:20 +02:00
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-T *STRING*, \--title-prefix=*STRING*
|
2007-07-02 01:26:20 +02:00
|
|
|
: Specify *STRING* as a prefix to the HTML window title.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
\--dump-args
|
2008-08-11 00:24:43 +02:00
|
|
|
: Print information about command-line arguments to *stdout*, then exit.
|
2007-07-02 01:26:20 +02:00
|
|
|
The first line of output contains the name of the output file specified
|
2008-08-11 00:24:43 +02:00
|
|
|
with the `-o` option, or \``-`' (for *stdout*) if no output file was
|
2007-07-02 01:26:20 +02:00
|
|
|
specified. The remaining lines contain the command-line arguments,
|
|
|
|
one per line, in the order they appear. These do not include regular
|
|
|
|
Pandoc options and their arguments, but do include any options appearing
|
2007-07-02 04:16:58 +02:00
|
|
|
after a \``--`' separator at the end of the line.
|
2007-07-02 01:26:20 +02:00
|
|
|
This option is intended primarily for use in wrapper scripts.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
\--ignore-args
|
2007-07-02 01:26:20 +02:00
|
|
|
: Ignore command-line arguments (for use in wrapper scripts).
|
|
|
|
Regular Pandoc options are not ignored. Thus, for example,
|
|
|
|
|
|
|
|
: pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
|
|
|
|
|
|
|
|
: is equivalent to
|
|
|
|
|
|
|
|
: pandoc -o foo.html -s
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-v, \--version
|
2007-07-02 01:26:20 +02:00
|
|
|
: Print version.
|
|
|
|
|
2007-07-08 05:31:26 +02:00
|
|
|
-h, \--help
|
2007-07-02 01:26:20 +02:00
|
|
|
: Show usage message.
|
|
|
|
|
|
|
|
# SEE ALSO
|
|
|
|
|
2008-08-02 19:56:09 +02:00
|
|
|
`hsmarkdown`(1),
|
2008-08-27 07:50:26 +02:00
|
|
|
`html2markdown`(1),
|
|
|
|
`markdown2pdf` (1).
|
2007-07-02 01:26:20 +02:00
|
|
|
The *README* file distributed with Pandoc contains full documentation.
|
|
|
|
|
|
|
|
The Pandoc source code and all documentation may be downloaded from
|
2007-09-13 19:26:01 +02:00
|
|
|
<http://johnmacfarlane.net/pandoc/>.
|
2007-07-02 01:26:20 +02:00
|
|
|
|