Supercollider Highlighter is a PHP library that applies syntax colour-coding to Supercollider code files for presentation on the web. It was designed for the Supercollider a day project and is based on code from Scott Hewitt’s ChucK Highlighter.
- Copy 'sc_highlighting.php' (and optionally 'sc_highlighting.css') to your directory.
- If using 'sc_highlighting.css', call
sc_add_stylesheet()
to add the formatting stylesheet. Use a string as the argument to add a prepath. - Call
sc_highlight_string()
to highlight a PHP string orsc_highlight_file()
to highlight a text file. With the latter, use the path to your Supercollider code file as the argument. Code will be placed within<pre>
tags automatically.
- 0.9.5: Code now displayed within
<pre>
and<code>
tags, not just<pre>
tags; comment<div>
now a<span>
element (as divs are not allowed inside pre tags); code is now escaped withhtmlspecialchars()
- 0.9.4: Added
sc_highlight_string()
andsc_highlight_file()
functions to replacesc_highlighter()
– these functions return a highlighted string rather than echoing directly. - 0.9.3: Fixed improper colouring of keywords within other words.
- 0.9.2: Colouring of |arg declarations| added.
- 0.9.1:
sc_add_stylesheet()
function added. - 0.9.0: First release.