pandoc – jgm
通用标记转换器
关键指标一览
主题标签
README 详细介绍
<!-- Do not edit this file. It is generated automatically from
README.template and MANUAL.txt via the command:
pandoc --lua-filter tools/update-readme.lua README.template -o README.md
-->
Pandoc
[](https://github.com/jgm/pandoc/releases)
[](https://hackage.haskell.org/package/pandoc)
<img src="https://img.shields.io/homebrew/v/pandoc.svg" alt="homebrew" class="ra0-md-img" loading="lazy" />
[](https://www.stackage.org/lts/package/pandoc)
[](https://github.com/jgm/pandoc/actions)
<img src="https://img.shields.io/badge/license-GPLv2+-lightgray.svg" alt="license" class="ra0-md-img" loading="lazy" />
[](https://groups.google.com/forum/#!forum/pandoc-discuss)
The universal markup converter
Pandoc is a Haskell library for converting from
one markup format to another, and a command-line tool that uses this
library.
It can convert from
<div id="input-formats">
asciidoc(AsciiDoc markup)bibtex(BibTeX bibliography)biblatex(BibLaTeX bibliography)bits(BITS XML, alias
for jats)
commonmark(CommonMark Markdown)commonmark_x(CommonMark Markdown with
extensions)
creole(Creole 1.0)csljson([CSL
JSON](https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html)
bibliography)
csv(CSV table)tsv
(TSV
table)
djot(Djot markup)docbook(DocBook)docx(Word docx)dokuwiki(DokuWiki markup)endnotexml([EndNote XML
bibliography](https://support.clarivate.com/Endnote/s/article/EndNote-XML-Document-Type-Definition))
epub(EPUB)fb2
(FictionBook2
e-book)
gfm([GitHub-Flavored
Markdown](https://help.github.com/articles/github-flavored-markdown/)),
or the deprecated and less accurate markdown_github; use
<code class="ra0-md-code">markdown_github</code>
only if you need extensions not supported in
<code class="ra0-md-code">gfm</code>.
haddock([Haddock
markup](https://www.haskell.org/haddock/doc/html/ch03s08.html))
html(HTML)ipynb([Jupyter
notebook](https://nbformat.readthedocs.io/en/latest/))
jats(JATS XML)jira
(Jira/Confluence
wiki markup)
json(JSON version of native AST)latex(LaTeX)markdown([Pandoc’s
Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown))
markdown_mmd
markdown_phpextra([PHP Markdown
Extra](https://michelf.ca/projects/php-markdown/extra/))
markdown_strict(original unextended
mediawiki([MediaWiki
markup](https://www.mediawiki.org/wiki/Help:Formatting))
markup)
muse(Muse)native(native Haskell)odt([OpenDocument text
document](https://en.wikipedia.org/wiki/OpenDocument))
opml(OPML)org(Emacs Org mode)pod(Perl’s [Plain Old
Documentation](https://perldoc.perl.org/perlpod))
pptx
ris(RIS)
bibliography)
rtf([Rich Text
Format](https://en.wikipedia.org/wiki/Rich_Text_Format))
rst
markup](https://doc.tiki.org/Wiki-Syntax-Text#The_Markup_Language_Wiki-Syntax))
twiki([TWiki
markup](https://twiki.org/cgi-bin/view/TWiki/TextFormattingRules))
spreadsheet](https://en.wikipedia.org/wiki/Microsoft_Excel#File_formats))
xml(XML version of native AST)- the path of a custom Lua reader, see [Custom readers and
writers](https://pandoc.org/MANUAL.html#custom-readers-and-writers)
below
</div>
It can convert to
<div id="output-formats">
ansi(text with [ANSI escape
codes](https://en.wikipedia.org/wiki/ANSI_escape_code), for terminal
viewing)
asciidoc(modern AsciiDoc as interpreted by
asciidoc_legacy(AsciiDoc as interpreted by
<code class="ra0-md-code">asciidoc-py</code>).
asciidoctor(deprecated synonym forasciidoc)bbcodeBBCodebbcode_fluxbb[BBCode
(FluxBB)](https://web.archive.org/web/20210623155046/https://fluxbb.org/forums/help.php#bbcode)
bbcode_phpbb[BBCode
(phpBB)](https://www.phpbb.com/community/help/bbcode)
bbcode_steam[BBCode
(Steam)](https://steamcommunity.com/comment/ForumTopic/formattinghelp)
bbcode_hubzilla[BBCode
(Hubzilla)](https://hubzilla.org/help/member/bbcode)
bbcode_xenforo[BBCode
(xenForo)](https://www.xenfocus.com/community/help/bb-codes/)
beamer(LaTeX beamer slide show)bibtex(BibTeX bibliography)biblatex(BibLaTeX bibliography)chunkedhtml(zip archive of multiple linked HTML files)commonmark(CommonMark Markdown)commonmark_x(CommonMark Markdown with
extensions)
context(ConTeXt)csljson([CSL
JSON](https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html)
bibliography)
djot(Djot markup)docbookordocbook4(DocBook 4)docbook5(DocBook 5)docx(Word docx)dokuwiki(DokuWiki markup)epuborepub3(EPUB v3 book)epub2(EPUB v2)fb2
(FictionBook2
e-book)
gfm([GitHub-Flavored
Markdown](https://help.github.com/articles/github-flavored-markdown/)),
or the deprecated and less accurate markdown_github; use
<code class="ra0-md-code">markdown_github</code>
only if you need extensions not supported in
<code class="ra0-md-code">gfm</code>.
haddock([Haddock
markup](https://www.haskell.org/haddock/doc/html/ch03s08.html))
htmlorhtml5(HTML,
i.e. HTML5/XHTML [polyglot
markup](https://www.w3.org/TR/html-polyglot/))
html4(XHTML 1.0 Transitional)icml([InDesign
ICML](https://web.archive.org/web/20211006210211/https://wwwimages.adobe.com/www.adobe.com/content/dam/acom/en/devnet/indesign/sdk/cs6/idml/idml-cookbook.pdf))
ipynb([Jupyter
notebook](https://nbformat.readthedocs.io/en/latest/))
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)
Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown))
markdown_mmd
markdown_phpextra([PHP Markdown
Extra](https://michelf.ca/projects/php-markdown/extra/))
markdown_strict(original unextended
markua(Markua)mediawiki([MediaWiki
markup](https://www.mediawiki.org/wiki/Help:Formatting))
document](https://en.wikipedia.org/wiki/OpenDocument))
opml(OPML)opendocument([OpenDocument
XML](https://www.oasis-open.org/2021/06/16/opendocument-v1-3-oasis-standard-published/))
org(Emacs Org mode)pdf(PDF)plain(plain text)pptx
(PowerPoint
slide show)
rst
rtf([Rich Text
Format](https://en.wikipedia.org/wiki/Rich_Text_Format))
texinfo(GNU Texinfo)textile(Textile)t2t(txt2tags)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)typst(typst)vimdoc
(Vimdoc)
xml(XML version of native AST)xwiki([XWiki
markup](https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/))
zimwiki([ZimWiki
markup](https://zim-wiki.org/manual/Help/Wiki_Syntax.html))
- the path of a custom Lua writer, see [Custom readers and
writers](https://pandoc.org/MANUAL.html#custom-readers-and-writers)
below
</div>
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 much
more. See the User’s Manual below under [Pandoc’s
Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown).
Pandoc has a modular design: it consists of a set of readers, which
parse text in a given format and produce a native representation of the
document (an abstract syntax tree or AST), and a set of writers, which
convert this native representation into a target format. Thus, adding an
input or output format requires only adding a reader or writer. Users
can also run custom pandoc filters to modify the intermediate AST (see
the documentation for filters and
Lua filters).
Because pandoc’s intermediate representation of a document is less
expressive than many of the formats it converts between, one should not
expect perfect conversions between every format and every other. Pandoc
attempts to preserve the structural elements of a document, but not
formatting details such as margin size. And some document elements, such
as complex tables, may not fit into pandoc’s simple document model.
While conversions from pandoc’s Markdown to all formats aspire to be
perfect, conversions from formats more expressive than pandoc’s Markdown
can be expected to be lossy.
Installing
Here’s how to install pandoc.
Documentation
Pandoc’s website contains a full [User’s
Guide](https://pandoc.org/MANUAL.html). It is also available
here as pandoc-flavored Markdown. The website also
contains some [examples of the use of
pandoc](https://pandoc.org/demos.html), a limited [online
demo](https://pandoc.org/try), and a [WebAssembly-based online
demo](https://pandoc.org/app).
Contributing
Pull requests, bug reports, and feature requests are welcome. Please
make sure to read the contributor guidelines before
opening a new issue.
License
© 2006-2024 John MacFarlane (jgm@berkeley.edu). Released under the
[GPL](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html "GNU General Public License"),
version 2 or greater. This software carries no warranty of any kind.
(See COPYRIGHT for full copyright and warranty notices.)