Syntax highlighting for Markdown READMEs

I love Markdown. I also love a well-written README… especially if it features ASCII art!

It’s no surprise, then, that all my READMEs on Bitbucket are written in Markdown (I favour the .text extension, but .md, .mkdn, and .markdown all work too). One thing I’ve wanted for a while is syntax highlighting of code blocks in READMEs. As of today, Bitbucket supports this feature, via Python-Markdown’s CodeHilite extension. Now, one can prefix a code block with :::javascript or :::python or whatever:

    $('.label').each ->
      label = $ this
      label.css backgroundColor: sexyhex label.text()

Which produces something like:

Highlighted CoffeeScript

Others won’t have had a chance to update their READMEs, so I’ll shamelessly plug a few projects which take advantage of this feature:

As developers, writing documentation is not necessarily one of our passions. But we all appreciate a good README when we come across one. Hopefully this small improvement will encourage some of us to give our neglected READMEs some love and attention.