Ruby Syntax Highlighting

Home

Ruby code syntax highlighting

def class PublicWikiConfig < Config

# User is always allowed to edit a public wiki def can_edit? true end end

is generated from the following source.

<!--Syntax:ruby
def class PublicWikiConfig < Config

# User is always allowed to edit a public wiki def can_edit? true end end -->

You need to download the 'syntax' gem and configure the plugin for this feature to work.

Edit the site/html/ruby.css stylesheet to your taste and reference it in your templates.

The default ruby.css is as follows:

.ruby .normal {}
.ruby .comment { color: #005; font-style: italic; }
.ruby .keyword { color: #A00; font-weight: bold; }
.ruby .method { color: #077; }
.ruby .class { color: #074; }
.ruby .module { color: #050; }
.ruby .punct { color: #447; font-weight: bold; }
.ruby .symbol { color: #099; }
.ruby .string { color: #944; background: #FFE; }
.ruby .char { color: #F07; }
.ruby .ident { color: #004; }
.ruby .constant { color: #07F; }
.ruby .regex { color: #B66; background: #FEF; }
.ruby .number { color: #F99; }
.ruby .attribute { color: #7BB; }
.ruby .global { color: #7FB; }
.ruby .expr { color: #227; }
.ruby .escape { color: #277; }