While writing the previous two posts I found the need to display Inform7 source code in a blog-friendly way. Unfortunatly, the pygments source highlighter doesn’t support it, and I couldn’t find any plugins for it that would. The closest I came was this blog post by Max Battcher, but as he mentions, pygments is probably a bad fit for this kind of code. Inform7 source is best displayed with a non-fixed-width font and uses regular line wrapping, but depends on significant whitespace for control flow. As far as I could tell, pygments doesn’t really support that kind of output, and anyway I couldn’t figure out how to use Python’s setuptools to hook up my own plugins to begin with.

So I did what any self-respecting hacker would do: I rolled my own solution using the tools I’m used to. In my case that means elisp, which is a good fit for med since Emacs is the tool I’m using to write this blog. I’ve put the code on GitHub it case it proves useful for the very small subset of Inform7 users who are also a) Emacs fanatics, and b) desperately in need of a HTML syntax highlighter.