CommonJS
Alex Gorbatchev edited this page Feb 20, 2016
·
5 revisions
These instructions apply to v4 and up. If you are looking for instructions for older version, please see the original manual.
💰 💰 💰 Please click here to donate via PayPal and just like they say on TV – give generously! It motivates me to keep working on this (12 years now and counting).
SyntaxHighlighter exposes CommonJS API.
This works in the browser and in Node.js. See the API for more details.
import PhpBrush from 'brush-php';
const brush = new PhpBrush();
const html = brush.getHtml('/* hello foo bar world! /*', {gutter: false});
This only works in the browser. See the API for more details.
import SyntaxHighlighter, {registerBrush} from 'syntaxhighlighter';
import PhpBrush from 'brush-php';
registerBrush(PhpBrush);
SyntaxHighlighter.highlight({gutter: false});