Display Line Numbers on Embedded Gists

Steven Harms ·

I've been working on a post here for C5 and in order to make my points, I was referencing gists hosted by GitHub. When those gists were shown as embeds, the line numbers, and thus the clarity of my documentation, was lost. We use Markdown for the creation of the texts so I needed something I could write inside of a Markdown post that would be applied as CSS.

Thanks to these tips:

  1. http://www.whyhat.com/2012/01/line-numbers-on-embedded-gists
  2. http://stackoverflow.com/questions/524696/how-to-create-a-style-tag-with-javascript

I was able to come up with the following: