Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edg-l/treelight
A syntax highlighter for the web using tree-sitter.
https://github.com/edg-l/treelight
Last synced: 18 days ago
JSON representation
A syntax highlighter for the web using tree-sitter.
- Host: GitHub
- URL: https://github.com/edg-l/treelight
- Owner: edg-l
- License: mit
- Created: 2021-05-18T09:02:09.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-09-09T09:06:55.000Z (about 2 years ago)
- Last Synced: 2024-10-06T01:13:05.938Z (29 days ago)
- Language: Rust
- Homepage: https://crates.io/crates/treelight
- Size: 53.7 KB
- Stars: 15
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# treelight
[![Version](https://img.shields.io/crates/v/treelight)](https://crates.io/crates/treelight)
[![Downloads](https://img.shields.io/crates/d/treelight)](https://crates.io/crates/treelight)
[![License](https://img.shields.io/crates/l/treelight)](https://crates.io/crates/treelight)
[![Docs](https://docs.rs/treelight/badge.svg)](https://docs.rs/treelight)
[![crev reviews](https://web.crev.dev/rust-reviews/badge/crev_count/treelight.svg)](https://web.crev.dev/rust-reviews/crate/treelight/)A syntax highlighter for the web using [tree-sitter](https://github.com/tree-sitter/tree-sitter).
```rust
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