I think I’ve more or less decided to switch my blog over to use Github Pages and
Jekyll. It’s pretty neat and it means I can sleep safer knowing that I’m not inadvertently
inflicting unpatched PHP on some poor unsuspecting web host.

One of the things that’s kind of annoying, though, is that Jekyll won’t correctly handle Literate Haskell out of the
box. You can drop code into a Markdown document and it will even syntax highlight it, but it doesn’t support any
syntax that also happens to line up with Literate Haskell.

We run a very basic state machine: each line is either part of a Literate Haskell block, or it isn’t.

dataState=LHS|Prosederiving(Eq)processNextLine::State->IO()processNextLinestate=doeof<-hIsEOFstdin-- UPDATE 3 April 2014: My program had a bug! It would not close the last-- Markdown group if the last line of the input program was Haskell code and-- not prose.when(eof&&state==LHS)$hPutStrLnstdout"```"unlesseof$casestateofLHS->processLhsLineProse->processProseLine

When looking at prose, all we need to do is watch out for lines that have bird tracks. If it’s anything else,
spit the line out verbatim.