peacock.defaultTheme

peacock.defaultTheme
Returns
Object: the default peacock theme used to highlight code

peacock.spans

peacock.spans
Returns
Object: the default peacock spans used to wrap code tokens

peacock.classes

peacock.classes
Returns
Object: the default peacock classes used to highlight code

peacock.highlight

Highlights the proviced code or throws an error if it was not able to parse it.

peacock.highlight
Parameters
code (String) to highlight
$0 (Object) options
Name Description
$0.theme (Object | String)? (default peacock.defaultTheme) to use when highlighting empty sample
$0.linenos Boolean? (default false) if true line numbers will be included
$0.jsx Boolean? (default true) if true peacock will support jsx syntax (which makes highlighting a tad bit slower)
Returns
String: the HTML with containing the highlighted code