edg-l / treelight

A syntax highlighter for the web using tree-sitter.

Home Page:https://crates.io/crates/treelight

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A syntax highlighter for the web using tree-sitter.

https://crates.io/crates/treelight

License:MIT License


Languages

Language:Rust 99.9%Language:Shell 0.1%