Pandoc is a Haskell library for converting from one markupformat to another, and a command-line tool that usesthis library. It can read several dialects of Markdown and(subsets of) HTML, reStructuredText, LaTeX, DocBook, JATS,MediaWiki markup, DokuWiki markup, TWiki markup,TikiWiki markup, Jira markup, Creole 1.0, Haddock markup,OPML, Emacs Org-Mode, Emacs Muse, txt2tags, ipynb (Jupyternotebooks), Vimwiki, Word Docx, ODT, EPUB, FictionBook2,roff man, and Textile, and it can write Markdown,reStructuredText, XHTML, HTML 5, LaTeX, ConTeXt, DocBook,JATS, OPML, TEI, OpenDocument, ODT, Word docx,PowerPoint pptx, RTF, MediaWiki, DokuWiki, XWiki,ZimWiki, Textile, Jira, roff man, roff ms, plain text,Emacs Org-Mode, AsciiDoc, Haddock markup,EPUB (v2 and v3), ipynb, FictionBook2,InDesign ICML, Muse, LaTeX beamer slides,and several kinds of HTML/JavaScript slide shows(S5, Slidy, Slideous, DZSlides, reveal.js).
In contrast to most existing tools for converting Markdownto HTML, pandoc has a modular design: it consists of a set ofreaders, which parse text in a given format and produce anative representation of the document, and a set of writers,which convert this native representation into a targetformat. Thus, adding an input or output format requiresonly adding a reader or writer.
[Index] [Quick Jump]
Name | Description | Default |
---|---|---|
static | Use static linking for pandoc executable. | Disabled |
embed_data_files | Embed data files in binary for relocatable executable. | Disabled |
trypandoc | Build trypandoc cgi executable. | Disabled |
Use-f <flag> to enable a flag, or-f -<flag> to disable that flag.More info
For package maintainers and hackage trustees
Candidates
Pandoc is aHaskell library for converting fromone markup format to another, and a command-line tool that uses thislibrary. It can convertfrom
commonmark
(CommonMark Markdown)creole
(Creole 1.0)docbook
(DocBook)docx
(Word docx)dokuwiki
(DokuWiki markup)epub
(EPUB)fb2
(FictionBook2e-book)gfm
(GitHub-FlavoredMarkdown),or the deprecated and less accuratemarkdown_github
; usemarkdown_github
only if you need extensions not supported ingfm
.haddock
(Haddockmarkup)html
(HTML)ipynb
(Jupyternotebook)jats
(JATS XML)jira
(Jirawiki markup)json
(JSON version of native AST)latex
(LaTeX)markdown
(Pandoc’sMarkdown)markdown_mmd
(MultiMarkdown)markdown_phpextra
(PHP MarkdownExtra)markdown_strict
(original unextendedMarkdown)mediawiki
(MediaWikimarkup)man
(roffman)muse
(Muse)native
(native Haskell)odt
(ODT)opml
(OPML)org
(Emacs Org mode)rst
(reStructuredText)t2t
(txt2tags)textile
(Textile)tikiwiki
(TikiWikimarkup)twiki
(TWikimarkup)vimwiki
(Vimwiki)It can convertto
asciidoc
(AsciiDoc) orasciidoctor
(AsciiDoctor)beamer
(LaTeX beamer slide show)commonmark
(CommonMark Markdown)context
(ConTeXt)docbook
ordocbook4
(DocBook 4)docbook5
(DocBook 5)docx
(Word docx)dokuwiki
(DokuWiki markup)epub
orepub3
(EPUB v3 book)epub2
(EPUB v2)fb2
(FictionBook2e-book)gfm
(GitHub-FlavoredMarkdown),or the deprecated and less accuratemarkdown_github
; usemarkdown_github
only if you need extensions not supported ingfm
.haddock
(Haddockmarkup)html
orhtml5
(HTML,i.e. HTML5/XHTMLpolyglotmarkup)html4
(XHTML 1.0 Transitional)icml
(InDesignICML)ipynb
(Jupyternotebook)jats
(JATS XML)jira
(Jirawiki markup)json
(JSON version of native AST)latex
(LaTeX)man
(roffman)markdown
(Pandoc’sMarkdown)markdown_mmd
(MultiMarkdown)markdown_phpextra
(PHP MarkdownExtra)markdown_strict
(original unextendedMarkdown)mediawiki
(MediaWikimarkup)ms
(roffms)muse
(Muse),native
(native Haskell),odt
(OpenOffice textdocument)opml
(OPML)opendocument
(OpenDocument)org
(Emacs Org mode)pdf
(PDF)plain
(plain text),pptx
(PowerPointslide show)rst
(reStructuredText)rtf
(Rich TextFormat)texinfo
(GNU Texinfo)textile
(Textile)slideous
(Slideous HTMLand JavaScript slide show)slidy
(Slidy HTML andJavaScript slide show)dzslides
(DZSlides HTML5 +JavaScript slide show),revealjs
(reveal.js HTML5 +JavaScript slide show)s5
(S5 HTML and JavaScriptslide show)tei
(TEI Simple)xwiki
(XWikimarkup)zimwiki
(ZimWikimarkup)Pandoc can also produce PDF output via LaTeX, Groff ms, or HTML.
Pandoc’s enhanced version of Markdown includes syntax for tables,definition lists, metadata blocks, footnotes, citations, math, and muchmore. See the User’s Manual below underPandoc’sMarkdown.
Pandoc has a modular design: it consists of a set of readers, whichparse text in a given format and produce a native representation of thedocument (anabstract syntax tree or AST), and a set of writers, whichconvert this native representation into a target format. Thus, adding aninput or output format requires only adding a reader or writer. Userscan also run custom pandoc filters to modify the intermediate AST (seethe documentation forfilters andlua filters).
Because pandoc’s intermediate representation of a document is lessexpressive than many of the formats it converts between, one should notexpect perfect conversions between every format and every other. Pandocattempts to preserve the structural elements of a document, but notformatting details such as margin size. And some document elements, suchas complex tables, may not fit into pandoc’s simple document model.While conversions from pandoc’s Markdown to all formats aspire to beperfect, conversions from formats more expressive than pandoc’s Markdowncan be expected to be lossy.
Here’show to install pandoc.
Pandoc’s website contains a fullUser’sGuide. It is also availablehere as pandoc-flavored Markdown. The website alsocontains someexamples of the use ofpandoc and a limitedonlinedemo.
Pull requests, bug reports, and feature requests are welcome. Pleasemake sure to readthe contributor guidelines beforeopening a new issue.
© 2006-2018 John MacFarlane (jgm@berkeley.edu). Released under theGPL,version 2 or greater. This software carries no warranty of any kind.(See COPYRIGHT for full copyright and warranty notices.)