treelight

Crates.iotreelight
lib.rstreelight
version0.3.2
sourcesrc
created_at2021-05-18 09:02:47.701746
updated_at2022-09-09 08:56:01.127917
descriptionA syntax highlighter for the web using tree-sitter.
homepage
repositoryhttps://github.com/edg-l/treelight
max_upload_size
id398915
size133,825,395
Edgar (edg-l)

documentation

https://docs.rs/treelight

README

treelight

Version Downloads License Docs crev reviews

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

Commit count: 31

cargo fmt