Node friendly version of Alex Gorbachev's great SyntaxHighlighter.
Using the current version of SyntaxHighlighter with nodejs is not straight forward.
Although it can be installed with npm by using the git repo url as package name, it is not obvious on how to use it with nodejs.
node-syntaxhighlighter tries to fix that and expose a nodejs friendly api to SyntaxHighlighter.
var nsh =language = nshcode = 'var nshRocks = true;';console;
More examples inside examples folder.
After installing the package run pageofself like so:
npm explore node-syntaxhighlightercd examplesnode pageofself
Resolves SyntaxHighlighter language for given alias and tries to use similar languages if strict is false. Returns that language or undefined if not found.
Highlights given code with SyntaxHighlighter language using given options with exceptions (see below).
For more information about options consult the SyntaxHighlighter configuration page.
Returns all available styles in the following format:
name: 'stylename' sourcePath: '/path/to/style.css'
Copies the given style to the given target path as 'stylename.css' and invokes callback when finished.
Copies all available styles to the given target path as 'stylename.css' and invokes callback when finished.
node-syntaxhighlighter includes a synchronization script which allows staying up to date with the original SyntaxHighlighter.
I will run this whenever a new version of SyntaxHighlighter becomes available and the publish the updated version.
The currently synced version is documented inside package.json as the "version-sync".