Darwinweb

Tm_syntax_highlighting Plugin Updated for Rails 3

January 21, 2010     

Darwinweb is now running Rails 3.0 pre-release. The full writeup is pending.

I added a couple new features as well, the most obvious being syntax highlighting. This gave me a chance to upgrade the venerable tm_syntax_highlighting plugin to Rails 3.0.

Here’s the new ultra-terse generator in fully highlighted glory.

require 'rails/generators'

class SyntaxCssGenerator < Rails::Generators::Base
  def install_syntax_css
    Uv.themes.each do |theme|
      fullpath = File.join(Uv.path, "render", "xhtml", "files", "css", "#{theme}.css")
      copy_file(fullpath, "public/stylesheets/syntax/#{theme}.css")
    end
  end
end
Gabe da Silveira says…
January 22, 2010 at 5:28PM

Comments are back in action.