Jun 03, 2015:  ~ 1 min read

Improving the syntax coloring

Until now I used pygments gem. I'm pretty sure it would have been just as good to keep using it, but I switched to rouge:

class HTML < Redcarpet::Render::HTML
  include Rouge::Plugins::Redcarpet
  def block_code(code, language)
    Rouge.highlight(code, language || 'text', 'html')

Then I swapped my pygments.sass file to pygments.scss and filled it with the theme from http://rouge.jneen.net, since I quite like it, and that was it. I'm pretty sure I will tweak the theme in the near future, but I'm happy for now.

There's also this little helper rougify style monokai.sublime > syntax.css.

Subscribe to my monthly newsletter.
No spam, unsubscribe at any time.