Syntax highlighter

How I syntax highlight code in this blog. CodeRay + regular expressions.

I’m using this app-only plugin called cache_html. It lets me do this:

class Post < ActiveRecord::Base
cache_html :intro, :content
end

This runs some parsing – textile and coderay – on that content, and stores it in [column_name]_html. Honestly, that’s kind of useless, as this app is using page caching, but oh well. Even the RSS feed is page cached, yawn.

So, the cache_html does it’s thing before_save, and this is one of the things: