Pandoc is awesome

I have just started to use pandoc and am blown away. I haven't really used many tools written in haskell, but I've always been impressed. Pandoc is no different. It converts one markup format into another and is able to convert to and from org files, which is a huge plus.

However, a warning: do not install pandoc from the debian repos!

At the time of this writing, Pandoc is v. 1.8.1.1 (2011-02-13). Org writer was included in v. 1.8 (2011-01-30). The current version in sid (unstable) is 1.5.11. The current version in experimental is 1.6-1.

This is a little too ridiculous if you ask me.

If you're on a debian system, do the following:

  • Install cabal
$ sudo aptitude install cabal-install
  • Update cabal
$ cabal update

The next step is not required, but it is just an easy way to get the most recent version of cabal and ditch the debian package in the process. Because you will have to add ~/.cabal to your path to run pandoc, it makes sense to do this in my opinion. If you don't do this step, cabal will whine about everything being deprecated (probably fine).

  • If it prints that there is a new version of cabal available, run the following:
$ cabal install cabal-install
  • If it whines about zlib, install the following with aptitude:
$ sudo aptitude install libghc6-zlib-dev zlibc
  • Install pandoc through cabal:
$ cabal install pandoc
  • Add cabal bin directory to your path, you can do this two ways:

– Temporary add:

$ export PATH=$PATH:~/.cabal/bin/

– Permanent add (for those using bash):

$ echo 'export PATH=$PATH:~/.cabal/bin/' >> .bashrc
$ source ~/.bashrc

Now go grab a markdown readme off of github or something and try the following:

$ pandoc -f markdown -t org README

You should have a nice org mode file!

For anybody who would like to compare version disparity between pandoc-debian and pandoc in cabal, here are the links:

debian: http://packages.debian.org/search?keywords=pandoc

pandoc: http://johnmacfarlane.net/pandoc/releases.html

fpc