e0984a43a9
This deprecates the use of the external pandoc-citeproc filter; citation processing is now built in to pandoc. * Add dependency on citeproc library. * Add Text.Pandoc.Citeproc module (and some associated unexported modules under Text.Pandoc.Citeproc). Exports `processCitations`. [API change] * Add data files needed for Text.Pandoc.Citeproc: default.csl in the data directory, and a citeproc directory that is just used at compile-time. Note that we've added file-embed as a mandatory rather than a conditional depedency, because of the biblatex localization files. We might eventually want to use readDataFile for this, but it would take some code reorganization. * Text.Pandoc.Loging: Add `CiteprocWarning` to `LogMessage` and use it in `processCitations`. [API change] * Add tests from the pandoc-citeproc package as command tests (including some tests pandoc-citeproc did not pass). * Remove instructions for building pandoc-citeproc from CI and release binary build instructions. We will no longer distribute pandoc-citeproc. * Markdown reader: tweak abbreviation support. Don't insert a nonbreaking space after a potential abbreviation if it comes right before a note or citation. This messes up several things, including citeproc's moving of note citations. * Add `csljson` as and input and output format. This allows pandoc to convert between `csljson` and other bibliography formats, and to generate formatted versions of CSL JSON bibliographies. * Add module Text.Pandoc.Writers.CslJson, exporting `writeCslJson`. [API change] * Add module Text.Pandoc.Readers.CslJson, exporting `readCslJson`. [API change] * Added `bibtex`, `biblatex` as input formats. This allows pandoc to convert between BibLaTeX and BibTeX and other bibliography formats, and to generated formatted versions of BibTeX/BibLaTeX bibliographies. * Add module Text.Pandoc.Readers.BibTeX, exporting `readBibTeX` and `readBibLaTeX`. [API change] * Make "standalone" implicit if output format is a bibliography format. This is needed because pandoc readers for bibliography formats put the bibliographic information in the `references` field of metadata; and unless standalone is specified, metadata gets ignored. (TODO: This needs improvement. We should trigger standalone for the reader when the input format is bibliographic, and for the writer when the output format is markdown.) * Carry over `citationNoteNum` to `citationNoteNumber`. This was just ignored in pandoc-citeproc. * Text.Pandoc.Filter: Add `CiteprocFilter` constructor to Filter. [API change] This runs the processCitations transformation. We need to treat it like a filter so it can be placed in the sequence of filter runs (after some, before others). In FromYAML, this is parsed from `citeproc` or `{type: citeproc}`, so this special filter may be specified either way in a defaults file (or by `citeproc: true`, though this gives no control of positioning relative to other filters). TODO: we need to add something to the manual section on defaults files for this. * Add deprecation warning if `upandoc-citeproc` filter is used. * Add `--citeproc/-C` option to trigger citation processing. This behaves like a filter and will be positioned relative to filters as they appear on the command line. * Rewrote the manual on citatations, adding a dedicated Citations section which also includes some information formerly found in the pandoc-citeproc man page. * Look for CSL styles in the `csl` subdirectory of the pandoc user data directory. This changes the old pandoc-citeproc behavior, which looked in `~/.csl`. Users can simply symlink `~/.csl` to the `csl` subdirectory of their pandoc user data directory if they want the old behavior. * Add support for CSL bibliography entry formatting to LaTeX, HTML, Ms writers. Added CSL-related CSS to styles.html. |
||
---|---|---|
.circleci | ||
.github | ||
benchmark | ||
citeproc/biblatex-localization | ||
data | ||
doc | ||
linux | ||
macos | ||
man | ||
prelude | ||
src/Text | ||
test | ||
tools | ||
trypandoc | ||
windows | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.hlint.yaml | ||
.mailmap | ||
.stylish-haskell.yaml | ||
.travis.yml | ||
AUTHORS.md | ||
BUGS | ||
cabal.project | ||
changelog.md | ||
CONTRIBUTING.md | ||
COPYING.md | ||
COPYRIGHT | ||
INSTALL.md | ||
Makefile | ||
MANUAL.txt | ||
pandoc.cabal | ||
pandoc.hs | ||
README.md | ||
README.template | ||
RELEASE-CHECKLIST | ||
Setup.hs | ||
stack.yaml |
Pandoc
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
commonmark
(CommonMark Markdown)commonmark_x
(CommonMark Markdown with extensions)creole
(Creole 1.0)csv
(CSV table)docbook
(DocBook)docx
(Word docx)dokuwiki
(DokuWiki markup)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)rst
(reStructuredText)t2t
(txt2tags)textile
(Textile)tikiwiki
(TikiWiki markup)twiki
(TWiki markup)vimwiki
(Vimwiki)
It can convert to
asciidoc
(AsciiDoc) orasciidoctor
(AsciiDoctor)beamer
(LaTeX beamer slide show)commonmark
(CommonMark Markdown)commonmark_x
(CommonMark Markdown with extensions)context
(ConTeXt)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)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 writers below
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.
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. It is also available here as pandoc-flavored Markdown. The website also contains some examples of the use of pandoc and a limited online demo.
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-2020 John MacFarlane (jgm@berkeley.edu). Released under the GPL, version 2 or greater. This software carries no warranty of any kind. (See COPYRIGHT for full copyright and warranty notices.)