Extension which provides support for code highlighting to Radiant CMS.
Somewhere in head of your pages put tags <r:include_code_stylesheets />
and <r:include_code_javascripts />
. These tags will include code stylesheets for selected theme and required javascripts (if you use client-side library). Also, you may not to use these tags, but include required files manually (for example, if you are using your own customized theme or javascript library).
In your pages put code between <r:code>
and </r:code>
tags. Supported attributes:
-
lang
- Code language. Set of supported languages depends on used code processor. -
lines
- Render line numbers:'table'
,'inline'
ornil
You may specify preferred code processor in code.processor
setting. Currently supported processors:
-
ultraviolet
- ultraviolet.rubyforge.org - syntax highlighting gem using texmate syntax files and so supporting a huge set of languages. -
coderay
- coderay.rubychan.de - fast syntax highlighting gem with no dependencies, and ability to inline styles (no stylesheets needed). -
syntax
- syntax.rubyforge.org -
highlight_js
- softwaremaniacs.org/soft/highlight - excellent client-side library by softwaremaniacs.org.
You may specify theme in code.theme
setting. Supported themes depends on selected processor.
In code.language
setting you may specify default language, which is supposed in tags without lang
attribute. If there are no such setting, ruby language is used.
Copyright © 2009 Alexey Noskov