Code syntax highlighter for ruby on rails
This is a basic code syntax highlighter using Hpricot and XML.
<%= link_to 'Home', root_path %>
<%= highlight_code(@article.article) %>
<%= highlight_textile_code(@article.article) %>
pre {
background: #000;
padding: 0 15px;
color: #fff;
}
pre code p {
margin: 0 0 5px;
}
.symbol, .keyword {
color: yellow;
}
.string {
color: #61cb3a;
}
.entity, .selector {
color: #ff740e;
}
.comment {
color: #555;
font-style: italic;
}
Copyright © 2008 Brad Haydon, released under the MIT license