Pandoc

Introduction

If you need to convert files from one markup format into another, pandoc is your swiss-army knife.

Pandoc can convert documents in markdown, reStructuredText, textile, HTML, DocBook, LaTeX, or MediaWiki markup to:

  • HTML formats: XHTML, HTML5, and HTML slide shows using Slidy, Slideous, S5, or DZSlides.

  • Word processor formats: Microsoft Word docx, OpenOffice/LibreOffice ODT, OpenDocument XML

  • Ebooks: EPUB version 2 or 3, FictionBook2

  • Documentation formats: DocBook, GNU TexInfo, Groff man pages

  • TeX formats: LaTeX, ConTeXt, LaTeX Beamer slides

  • PDF via LaTeX

  • Lightweight markup formats: Markdown, reStructuredText, AsciiDoc, MediaWiki markup, Emacs Org-Mode, Textile

Pandoc source code

Pandoc has a publicly accessible git repository at github. To get a local copy of the source:

git clone git://github.com/jgm/pandoc.git

After cloning the repository (and in the future after pulling from it), you should do:

git submodule update --init

to pull in changes to the templates.

You can automate this by creating a file .git/hooks/post-merge with the contents:

#!/bin/sh
git submodule update --init

and making it executable:

chmod +x .git/hooks/post-merge

The modules Text.Pandoc.Definition, Text.Pandoc.Builder, and Text.Pandoc.Generics are in a separate package pandoc-types.

The code can be found in this repository (http://github.com/jgm/pandoc-types).