Expand description

This provides a set of prebuilt highlighters for various languages You can always build on top of them, as they just return highlighter classes These highlighters will return the following tokens names:

keyword - a keyword for that language boolean - a boolean comment - a comment (both multiline and single line) string - a string data type number - a number function - a function identifier macro - a macro identifier struct - a class / struct / enum / trait name operator - operators within that language e.g. == or != or >= or + namespace - a namespace for modules character - a character data type attribute - an attribute within the language reference - for references within the language e.g. &self or &mut symbol - a symbol data type (mainly for the Ruby language) global - for global variable identifiers regex - for regex datatypes in languages header - for headers (mainly for the C language)

These syntax highlighters are quite advanced and tend to do a decent job of syntax highlighting with detail of which wouldn’t be out of place in a popular text editor. there may be an edge case where something goes a bit wrong, in that case, please open an issue

Functions

Obtain the python syntax highlighter

Obtain the rust syntax highlighter