Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A RadiantCMS extension to provide syntax highlighting via the CodeRay ruby gem

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 lib
Octocat-spinner-32 public
Octocat-spinner-32 spec
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 code_ray_extension.rb
= Code Ray

The extension adds the new <r:code [language]></r:code> tag to Radiant that
converts source code in multiple languages to HTML.  It is based on the Syntax
Highlighting plugin by Marco Otte-Witte, but uses the CodeRay ruby gem instead
of Python's Pygments.

== Installation

- Install CodeRay

  sudo gem install coderay

- Get the extension

From your radiant project's path, do

  git clone git:// vendor/extensions/code_ray

- Run the installation script

  RAILS_ENV=production rake radiant:extensions:code_ray:update

- Include stylesheets

The coderay.css stylesheet is automatically copied to your public/stylesheets directory. 
All you need to do is to include it in your layout.

== Usage

To add highlighted code to a page, use the <r:code [language] [line_numbers] [textile]> tag like so:

  <r:code language="ruby" line_numbers="true">
  class Foo
    def bar
      puts 'foo bar'

Note: If you are using Textile be sure to add <notexttile>...</notextile> tags around the <r:code /> call or
pass the textile="true" attribute.

== Author

Copyright (c) 2008 Philip Hallstrom (, released under the MIT license

== Acknowledgements

The actual highlighting is done by CodeRay (
Inspired by Marco Otte-Witte's ( Syntax Highlighting extension (
Something went wrong with that request. Please try again.