1 unstable release

0.20.0 Dec 7, 2023

#471 in Text editors

Download history 139/week @ 2024-06-02 132/week @ 2024-06-09 134/week @ 2024-06-16 128/week @ 2024-06-23 123/week @ 2024-06-30 126/week @ 2024-07-07 131/week @ 2024-07-14 126/week @ 2024-07-21 142/week @ 2024-07-28 128/week @ 2024-08-04 125/week @ 2024-08-11 126/week @ 2024-08-18 127/week @ 2024-08-25 128/week @ 2024-09-01 127/week @ 2024-09-08 126/week @ 2024-09-15

524 downloads per month

MIT license

90KB
3K SLoC

C 2.5K SLoC // 0.0% comments JavaScript 114 SLoC // 0.1% comments Rust 36 SLoC // 0.1% comments Scheme 18 SLoC

tree-sitter-html

This crate provides a HTML grammar for the tree-sitter parsing library. To use this crate, add it to the [dependencies] section of your Cargo.toml file. (Note that you will probably also need to depend on the tree-sitter crate to use the parsed result in any useful way.)

[dependencies]
tree-sitter = "0.20.10"
tree-sitter-html = "0.20.0"

Typically, you will use the language function to add this grammar to a tree-sitter Parser, and then use the parser to parse some code:

let code = r#"
    def double(x):
        return x * 2
"#;
let mut parser = Parser::new();
parser.set_language(tree_sitter_html::language()).expect("Error loading HTML grammar");
let parsed = parser.parse(code, None);

If you have any questions, please reach out to us in the tree-sitter discussions page.

Dependencies

~2.7–4MB
~72K SLoC