Module rustdoc::html::highlight
[−]
[src]
rustdoc
)Basic syntax highlighting functionality.
This module uses libsyntax's lexer to provide token-based highlighting for the HTML documentation generated by rustdoc.
If you just want to syntax highlighting for a Rust program, then you can use
the render_inner_with_highlighting
or render_with_highlighting
functions. For more advanced use cases (if you want to supply your own css
classes or control how the HTML is generated, or even generate something
other then HTML), then you should implement the the Writer
trait and use a
Classifier
.
Structs
Classifier |
[Unstable] Processes a program (nested in the internal |
Enums
Class |
[Unstable] How a span of text is classified. Mostly corresponds to token kinds. |
Traits
Writer |
[Unstable] Trait that controls writing the output of syntax highlighting. Users should implement this trait to customise writing output. |
Functions
render_inner_with_highlighting |
[Unstable] Highlights |
render_with_highlighting |
[Unstable] Highlights |