pandoc-mode is an Emacs mode for interacting with pandoc. Pandoc is a program (plus libraries) written by John MacFarlane that can convert a text written in one markup language into another markup language. It supports as input formats markdown and (subsets of) reStructuredText, HTML, and LaTeX, and as output formats markdown, reStructuredText, HTML, LaTeX, ConTeXt, PDF, RTF, DocBook XML, EPUB e-books, OpenDocument XML, OpenOffice.org text document (odt), GNU Texinfo, MediaWiki markup, groff man pages, and S5 HTML and Slidy slide shows.
pandoc-mode is implemented as a minor mode that can be activated alongside the major mode for any of the supported input formats. It provides facilities to set the various options that pandoc accepts and to run pandoc on the input file. Features include:
- Different output profiles for a single input file, so that you can, for example, write your text in markdown and then translate it to HTML for online reading, PDF for offline reading and Texinfo for reading in Emacs.
- Settings can be saved and loaded automatically when an input file is opened.
- Project files, that define settings that apply to all files in a specific directory (which can be overridden on a per-file basis).
- Embeddable Elisp code that runs before the input file is sent to pandoc.
Download
The source code is released under a BSD-license and available here:
Version 0.1.8: pandoc-mode.el
The development sources for pandoc-mode are also available at Github.com.
Please report any bugs you may find to me.
Also, if you have any suggestions for improvements, I'd appreciate hearing them.
Manual
The manual for pandoc-mode is available as HTML and as PDF.
Know issues
On OS X, if you install pandoc through cabal into your home directory and add ~/.cabal/bin to your path in ~/.profile, ~/.bashrc or some other shell's rc file, it is likely that Emacs won't see this changed PATH variable. If you then run markdown2pdf from within Emacs, you'll get an error in the output buffer:
markdown2pdf: Could not find pandoc
The easiest way to remedy this is to add the following line to your ~/.emacs:
(setenv "PATH" (concat "/Users/<user_name>/.cabal/bin:" (getenv "PATH")))
Change