pub struct HighlightOptions {
pub highlighter: Option<Arc<Highlighter>>,
pub theme: Option<Theme>,
pub idiomatic: bool,
}highlight only.Expand description
Syntax-highlighting configuration for the writers that colorize code blocks (the HTML family, LaTeX, and DOCX). The default leaves code blocks unhighlighted.
Fields§
§highlighter: Option<Arc<Highlighter>>The tokenizer catalog. None leaves code blocks as a plain <pre><code>, with no color
spans and no line-number scaffolding.
theme: Option<Theme>The active color theme, consulted by the writers that inline colors (LaTeX, DOCX) and to
build the HTML family’s stylesheet. None when highlighting is off.
idiomatic: boolPresent code blocks in the target format’s own listing construct rather than colorizing them.
No tokenizer runs; a format that offers a dedicated listing environment (LaTeX’s lstlisting)
uses it, while formats whose plain form already carries the language class (the HTML family,
DOCX) render code exactly as they do with highlighting off. Ignored when a highlighter is set.
Trait Implementations§
Source§impl Clone for HighlightOptions
impl Clone for HighlightOptions
Source§fn clone(&self) -> HighlightOptions
fn clone(&self) -> HighlightOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more