Skip to main content

Module syntax_highlight

Module syntax_highlight 

Source

Functions§

available_themes
Get all available theme names
default_theme_name
Get the default syntax theme name
find_syntax_by_extension
Find syntax by file extension
find_syntax_by_name
Find syntax by exact name
find_syntax_by_token
Find syntax by language token (e.g., “rust”, “python”)
find_syntax_plain_text
Get plain text syntax fallback
get_active_syntax_theme
Get the recommended syntax theme for the current core UI theme.
get_syntax_theme
Get the recommended syntax theme for a specific UI theme.
highlight_code_to_ansi
Convert code to ANSI escape sequences
highlight_code_to_anstyle_line_segments
Highlight code and convert to anstyle segments with optional bg stripping.
highlight_code_to_line_segments
Highlight code and return styled segments per line.
highlight_code_to_segments
Highlight code and return styled segments
highlight_line_for_diff
Highlight a single line (for diff rendering)
highlight_line_to_anstyle_segments
Highlight one line and convert to anstyle segments with optional bg stripping.
load_theme
Load a theme from the process-global theme set.
should_highlight
Check if input should be highlighted (guardrails)
syntax_set
Get the global SyntaxSet reference