Crate dialect

Source
Expand description

Types and traits for implementing syntax highlighting.

Modules§

themes
Some common themes, pre-implemented for convenience.

Macros§

rgb
Allows easy creation of a Rgb.

Structs§

HighlightGroupIter
HighlightedSpan
An individual fragment of highlighted text.
ResolvedStyle
Identical to a Style, except that all its fields are mandatory.
Rgb
An RGB colour.
Style
The styling applied to a given HighlightGroup.
StyledGrapheme
An individual styled grapheme.

Enums§

HighlightGroup
The set of possible syntactical forms text can be assigned.

Traits§

Highlight
This trait is to be implemented by any type that syntax highlights source code for a particular language. This is done by taking in a string slice and outputting a vector of HighlightedSpans.
Theme
A trait for defining syntax highlighting themes.

Functions§

render
A convenience function that renders a given input text using a given highlighter and theme, returning a vector of StyledGraphemes.