public
Description: Syntax Highlighting extension for RadiantCMS
Home | Edit | New

Home

Syntax Highlighting

The Syntax Highlighting extension adds the new tag to Radiant that converts source code in multiple languages to HTML.

Also see Highlight, a syntax highlighting plugin for Ruby on Rails: http://github.com/marcoow/highlight/!

Installation

Installation of the extension requires 4 simple steps.

instally Pygments

The extension uses Pygments (http://pygments.org/) to perform the actual highlightin, so you would have to install that first.

get the extension

From your radiant project’s path, do

git clone git://github.com/marcoow/syntax_highlighting.git vendor/extensions/syntax_highlighting

run the installation script

rake radiant:extensions:syntax_highlighting:install

include stylesheets

The syntax_highlighting.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 tag like so:

  <r:code language="ruby">
  class Mylass

def do puts ‘doing’ end end

Author

Copyright © 2008 Marco Otte-Witte (http://simplabs.com), released under the MIT license

Acknowledgements

The actual highlighting is done by Pygments (http://pygments.org).

Last edited by marcoow, Tue Nov 11 02:36:21 -0800 2008
Home | Edit | New
Versions: