7 releases
0.3.2 | Sep 9, 2022 |
---|---|
0.3.1 | Feb 11, 2022 |
0.2.0 | Dec 14, 2021 |
0.1.2 | May 18, 2021 |
#1393 in Text processing
24 downloads per month
129MB
4M
SLoC
treelight
A syntax highlighter for the web using tree-sitter.
use treelight::*;
let code = r#"
use thiserror::Error;
#[derive(Error, Debug)]
pub enum ResponseError {
#[error("api error {0}")]
ApiError(#[from] PaypalError),
#[error("http error {0}")]
HttpError(#[from] reqwest::Error)
}
"#;
let result = highlight_to_html(Language::Rust, code);
println!("{}", result);
License: MIT
lib.rs
:
A syntax highlighter for the web using tree-sitter.
use treelight::*;
let code = r#"
use thiserror::Error;
#[derive(Error, Debug)]
pub enum ResponseError {
#[error("api error {0}")]
ApiError(#[from] PaypalError),
#[error("http error {0}")]
HttpError(#[from] reqwest::Error)
}
"#;
let result = highlight_to_html(Language::Rust, code);
println!("{}", result);
Dependencies
~3–5MB
~91K SLoC