Exporting Literate Haskell With HSColour and Pandoc

Posted on March 14, 2014

In yesterday’s post I said I would detail the workflow from literate Haskell + markdown to postable html, so here we go:

Requirements: You need to have Haskell installed somehow. I generally recommend the Haskell Platform installed through your OS’s package manager (pacman, apt-get, homebrew…). At a minimum, you need ghc and cabal-install Next, you need hscolour and pandoc installed. If you already have them, great! If not, run these commands:

cabal install hscolour
cabal install pandoc

Once you have those installed, it’s relatively simple - just run this script:

There you go! Now you’ve highlighted the code bits, and left the rest to be formatted as markdown!