Skip to main content

Module syntax

Module syntax 

Source
Expand description

Syntax highlighting with tree-sitter.

This module provides syntax highlighting using tree-sitter-highlight with one grammar per enabled lang-* cargo feature. Languages whose feature is disabled report as unsupported at runtime.

All grammar crates communicate through the version-agnostic tree-sitter-language ABI, so a single tree-sitter generation (0.25) works for every bundled language.

Structs§

SyntaxHighlighter
Syntax highlighter for highlighting code

Functions§

highlight_code_blocks
Highlight all <pre><code class="language-..."> blocks in rendered HTML.