18F/18f.gsa.gov — pull request #327 by konklone (2014-10-26 19:36:37+00:00)
Title: Syntax highlighting for blog posts

![syntax](https://cloud.githubusercontent.com/assets/4592/4784170/0524e14c-5d47-11e4-9b72-d84d86802d92.png)

This PR adds syntax highlighting in our blog posts, using GitHub Flavored Markdown syntax (fenced code blocks using backticks + language name).

Notably, this **changes the Markdown renderer** for the site from Kramdown to Redcarpet. Redcarpet is a C-based Markdown renderer that was, for a time, used by GitHub itself to do its Markdown rendering. It and its extensions are well-supported by Jekyll. I checked a bunch of our posts and nothing seemed to be different after the change. It's not impossible I missed something, but the differences in Markdown renderers tend to come in to play when using advanced Markdown features (like syntax highlighting).

Syntax highlighting is done using the [Pygments](http://pygments.org) renderer, built into Jekyll. This introduces a subtle Python 2.7 dependency, which I've documented in the README and accommodated for `pyenv` users with a `.python-version` file in the project root.

I've included a Pygments theme adapted off of a theme GitHub used to use. It could definitely be updated, but it's pretty reasonable. That updates the **text only**, not the background. For the background and border and spacing of the `

` blocks, I added my own custom CSS, which I'm sure could also be updated to be nicer. Horizontal scrolling is used for text overflow. I also styled inline `` blocks.

What it looks like in an upcoming blog post:

![syntax-example](https://cloud.githubusercontent.com/assets/4592/4784174/38a13e3a-5d47-11e4-9212-639a91308258.png)

Fixes #222.