Skip to content
This repository

HTTPS clone URL

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…

Octocat-spinner-32-eaf2f5

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
README
= 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://github.com/phallstrom/code_ray.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'
    end
  
  end
  </r:code>

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 (http://pjkh.com), released under the MIT license

== Acknowledgements

The actual highlighting is done by CodeRay (http://coderay.rubychan.de/).
Inspired by Marco Otte-Witte's (http://simplabs.com) Syntax Highlighting extension (http://github.com/marcoow/syntax_highlighting).
Something went wrong with that request. Please try again.