Display Line Numbers on Embedded Gists

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:

This entry was posted in Web. Bookmark the permalink.
  • Mike Perham

    Is there no code embedding service that supports line numbers?

  • Jared Carroll

    No line numbers on gists?!? Whaaat?

    Thanks for the codes.

  • http://sagraffo.pl Paweł Gościcki

    Too bad those gists are invisible in Google Reader :/

    • http://twitter.com/sgharms Steven G. Harms

      You’re completely right, Pawel. It’s worth nothing that these will not work in an RSS reader. Strange that between this complain and what Mike Perham mentioned below, a bunch of developers who _can_ develop the solution _haven’t_.

      Something about the cobbler’s children?