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 次下载
129MB
4M SLoC
treelight
使用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
:
使用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