[][src]Module rustdoc::html::highlight

Basic syntax highlighting functionality.

This module uses libsyntax's lexer to provide token-based highlighting for the HTML documentation generated by rustdoc.

Use the render_with_highlighting to highlight some rust code.

Structs

Classifier

Processes a program (nested in the internal lexer), classifying strings of text by highlighting category (Class). Calls out to a Writer to write each span of text in sequence.

Enums

Class

How a span of text is classified. Mostly corresponds to token kinds.

Traits

Writer

Trait that controls writing the output of syntax highlighting. Users should implement this trait to customize writing output.

Functions

render_with_highlighting

Highlights src, returning the HTML output.

write_footer
write_header