Pandoc 是一个用于从一种标记格式转换为另一种标记格式的 Haskell 库,也是一个使用该库的命令行工具。
Pandoc 还可以通过 LaTeX、Groff ms 或 HTML 生成 PDF 输出。
Pandoc 的 Markdown 增强版包括表格语法、定义列表、元数据块、脚注、引文、数学等等。请参阅下面 Pandoc 的 Markdown 下的用户手册。
Pandoc 具有模块化设计:它由一组读取器组成,它们以给定格式解析文本并生成文档的本地表示(抽象语法树或 AST),以及一组写入器,将这种本地表示转换为一种目标格式。因此,添加输入或输出格式只需要添加读取器或写入器。用户还可以运行自定义 pandoc 过滤器来修改中间 AST(请参阅过滤器和 Lua 过滤器的文档)。
因为 pandoc 对文档的中间表示比它在其之间转换的许多格式的表现力要差,所以人们不应该期望在每种格式和其他格式之间都能完美转换。 Pandoc 试图保留文档的结构元素,但不保留诸如边距大小之类的格式细节。并且某些文档元素,例如复杂的表格,可能不适合 pandoc 的简单文档模型。虽然从 pandoc 的 Markdown 到所有格式的转换都渴望完美,但从比 pandoc 的 Markdown 更具表现力的格式转换可以预期是有损的。
它可以从
bibtex
(BibTeX bibliography)biblatex
(BibLaTeX bibliography)commonmark
(CommonMark Markdown)commonmark_x
(CommonMark Markdown with extensions)creole
(Creole 1.0)csljson
(CSL JSON bibliography)csv
(CSV table)tsv
(TSV table)docbook
(DocBook)docx
(Word docx)dokuwiki
(DokuWiki markup)endnotexml
(EndNote XML bibliography)epub
(EPUB)fb2
(FictionBook2 e-book)gfm
(GitHub-Flavored Markdown), or the deprecated and less accuratemarkdown_github
; usemarkdown_github
only if you need extensions not supported ingfm
.haddock
(Haddock markup)html
(HTML)ipynb
(Jupyter notebook)jats
(JATS XML)jira
(Jira/Confluence wiki markup)json
(JSON version of native AST)latex
(LaTeX)markdown
(Pandoc’s Markdown)markdown_mmd
(MultiMarkdown)markdown_phpextra
(PHP Markdown Extra)markdown_strict
(original unextended Markdown)mediawiki
(MediaWiki markup)man
(roff man)muse
(Muse)native
(native Haskell)odt
(ODT)opml
(OPML)org
(Emacs Org mode)ris
(RIS bibliography)rtf
(Rich Text Format)rst
(reStructuredText)t2t
(txt2tags)textile
(Textile)tikiwiki
(TikiWiki markup)twiki
(TWiki markup)vimwiki
(Vimwiki)- the path of a custom Lua reader, see Custom readers and writers below
它可以转换为
asciidoc
(AsciiDoc) orasciidoctor
(AsciiDoctor)beamer
(LaTeX beamer slide show)bibtex
(BibTeX bibliography)biblatex
(BibLaTeX bibliography)commonmark
(CommonMark Markdown)commonmark_x
(CommonMark Markdown with extensions)context
(ConTeXt)csljson
(CSL JSON bibliography)docbook
ordocbook4
(DocBook 4)docbook5
(DocBook 5)docx
(Word docx)dokuwiki
(DokuWiki markup)epub
orepub3
(EPUB v3 book)epub2
(EPUB v2)fb2
(FictionBook2 e-book)gfm
(GitHub-Flavored Markdown), or the deprecated and less accuratemarkdown_github
; usemarkdown_github
only if you need extensions not supported ingfm
.haddock
(Haddock markup)html
orhtml5
(HTML, i.e. HTML5/XHTML polyglot markup)html4
(XHTML 1.0 Transitional)icml
(InDesign ICML)ipynb
(Jupyter notebook)jats_archiving
(JATS XML, Archiving and Interchange Tag Set)jats_articleauthoring
(JATS XML, Article Authoring Tag Set)jats_publishing
(JATS XML, Journal Publishing Tag Set)jats
(alias forjats_archiving
)jira
(Jira/Confluence wiki markup)json
(JSON version of native AST)latex
(LaTeX)man
(roff man)markdown
(Pandoc’s Markdown)markdown_mmd
(MultiMarkdown)markdown_phpextra
(PHP Markdown Extra)markdown_strict
(original unextended Markdown)markua
(Markua)mediawiki
(MediaWiki markup)ms
(roff ms)muse
(Muse)native
(native Haskell)odt
(OpenOffice text document)opml
(OPML)opendocument
(OpenDocument)org
(Emacs Org mode)pdf
(PDF)plain
(plain text)pptx
(PowerPoint slide show)rst
(reStructuredText)rtf
(Rich Text Format)texinfo
(GNU Texinfo)textile
(Textile)slideous
(Slideous HTML and JavaScript slide show)slidy
(Slidy HTML and JavaScript slide show)dzslides
(DZSlides HTML5 + JavaScript slide show)revealjs
(reveal.js HTML5 + JavaScript slide show)s5
(S5 HTML and JavaScript slide show)tei
(TEI Simple)xwiki
(XWiki markup)zimwiki
(ZimWiki markup)- the path of a custom Lua writer, see Custom readers and writers below