Crate highlight_ez

Source
Expand description

Create HTML renderings of code with highlighting using tree-sitter

The general workflow of this is to simplify the workflow of creating pretty html code blocks using tree-sitter.

let my_pyblock = r#"def fib(a):
    if a = 1:
        return 1
    else:
        return fib(a - 1)"#;
let lang = TargetLanguage::Python;
let html = render_html(my_pyblock, lang);

Enums§

TargetLanguage
List of target-able languages for highlighting

Functions§

generate_parser
Generate a parser for the language by calling tree-sitter
render_html
Render the code block into HTML, using the styling defaulted to by tree-sitter