Skip to content

A PHP library that applies syntax colour-coding to Supercollider code files for presentation on the web

License

Notifications You must be signed in to change notification settings

adamjansch/Supercollider-Highlighter

Repository files navigation

Supercollider Highlighter

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.

Usage

  1. Copy 'sc_highlighting.php' (and optionally 'sc_highlighting.css') to your directory.
  2. If using 'sc_highlighting.css', call sc_add_stylesheet() to add the formatting stylesheet. Use a string as the argument to add a prepath.
  3. Call sc_highlight_string() to highlight a PHP string or sc_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.

Change log

  • 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 with htmlspecialchars()
  • 0.9.4: Added sc_highlight_string() and sc_highlight_file() functions to replace sc_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.

About

A PHP library that applies syntax colour-coding to Supercollider code files for presentation on the web

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published