# Syntaxmate
[](https://crates.io/crates/syntaxmate)
[](https://docs.rs/syntaxmate)
[](https://github.com/phongndo/syntaxmate/actions/workflows/ci.yml)
[](LICENSE)
A fast, Rust-native syntax highlighter powered by TextMate grammars.
Bundled languages and GitHub themes, incremental highlighting, safe HTML and
ANSI output, and no native Oniguruma dependency.
[**Documentation**](https://docs.rs/syntaxmate) ·
[**Examples**](examples) ·
[**Benchmarks**](benchmarks/competitors/README.md) ·
[**Languages**](docs/language-status.md) ·
[**Compatibility**](docs/compatibility.md)
## Usage
```toml
[dependencies]
syntaxmate = "0.1"
```
```rust
use syntaxmate::Highlighter;
let mut highlighter = Highlighter::bundled()?;
let output = highlighter.highlight_html(
"rust",
"fn main() { println!(\"<hello>\"); }",
"github-dark",
)?;
assert!(output.status().is_complete());
println!("{}", output.as_str());
# Ok::<(), syntaxmate::Error>(())
```
## License
[MIT](LICENSE)