Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: master
34 lines (22 sloc) 1.318 kb
Currently, almost everything what I write is rendered by Ruby on Rails
and Sinatra applications. To improve the readability of the text, I
want the code fragments to be colored. So extending Rails and Sinatra
frameworks with syntax highlighting is a must.
The problem is to how syntax highlighting features are hooked into
these frameworks.
Look at the current practice. To this end, analyze the top three tools
listed on *The Ruby Toolbox* in category
[Syntax Highlighting](
[tm_syntax_highlighting]( (plugin):
code(some_ruby_code, :theme => "twilight", :lang => "ruby", :line_numbers => true)
[harsh]( (plugin):
<% harsh :theme => :dawn do %> | <% harsh %Q{ some_ruby_code }, :theme => :dawn %>
some_ruby_code |
<% end %> |
[Redcloth with CodeRay]( (gem):
<source:ruby> some_ruby_code </source>
In each piece of code inserted into html we must change:
`<` to `&lt;`. This is annoying thing.
Analyze packages mentioned at the *The Ruby Toolbox* page:
[Syntax Highlighting](
Jump to Line
Something went wrong with that request. Please try again.