7个版本

0.3.2 2022年9月9日
0.3.1 2022年2月11日
0.2.0 2021年12月14日
0.1.2 2021年5月18日

1393文本处理

每月 24 次下载

MIT 许可证

129MB
4M SLoC

C 4M SLoC // 0.0% comments JavaScript 14K SLoC // 0.0% comments C++ 2.5K SLoC // 0.0% comments Scheme 2K SLoC // 0.1% comments Rust 520 SLoC // 0.0% comments

treelight

Version Downloads License Docs crev reviews

使用tree-sitter的Web语法高亮器。

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);

许可证: MIT


lib.rs:

Version Downloads License Docs crev reviews

使用tree-sitter的Web语法高亮器。

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);

依赖关系

~3–5MB
~91K SLoC