[go: up one dir, main page]

Module syntect::html [] [src]

Rendering highlighted code as HTML+CSS

Enums

ClassStyle

Only one style for now, I may add more class styles later. Just here so I don't have to change the API

Functions

styles_to_coloured_html

Output HTML for a line of code with <span> elements using inline style attributes to set the correct font attributes. The bg attribute determines if the spans will have the background-color attribute set. This adds a lot more text but allows different backgrounds.

tokens_to_classed_html

Output HTML for a line of code with <span> elements specifying classes for each token. The span elements are nested like the scope stack and the scopes are mapped to classes based on the ClassStyle (see it's docs).