Skip to main content

Module syntax

Module syntax 

Source
Expand description

Syntax highlighting via syntect (100+ languages, Sublime Text theme support). Syntax highlighting — equivalent to Rich’s syntax.py.

Uses syntect for syntax highlighting (Rust equivalent of Pygments).

Structs§

ANSISyntaxTheme
A syntax theme that maps to ANSI colors (lightweight, no Pygments dependency).
Syntax
A syntax-highlighted source code renderable.

Traits§

SyntaxTheme
Trait for syntax themes.

Functions§

get_lexer_by_name
Resolve a lexer name (case-insensitive) to a canonical name.
get_style_by_name
Get a pre-built ANSISyntaxTheme by name.
guess_lexer_for_filename
Guess the syntax lexer name from a filename or file path.