CommonMark and Prism
Posted on 2014-11-21
After a very, very small amount of effort, I've modified my blog to use two unconnected but highly complimentary goodies: a python implementation of CommonMark and Prism syntax highlighting. You can see the results on my last post, PHP recursion with anonymous functions; each code example should be extra stylish and fancy.
CommonMark was required because ordinary MarkDown doesn't have the needed features to add a language to a code block. Besides, John Gruber is a jerk, and he's let MarkDown twist in the wind. CommonMark seems to be taking it where it needs to go, and has loads of smart people behind it.
Prism is an excellent syntax highlighting library that makes your <code>
blocks look like they're being rendered in a full editor. I have to hack in some non-JS defaults to prevent it from looking like ass whenever Javascript isn't available, but that's pretty low on the list.
A small improvement, but I feel like it's going to make any code-based posts more usable by a few orders of magnitude. Thanks to both Bibek Kafle and Roland Shoemaker (CommonMark for Python guys) and Lea Verou (Prism) for making these so easy to integrate!