syntaxmate 0.1.1

Rust-native TextMate syntax highlighting with bundled grammars and themes
Documentation
1
2
3
4
5
6
7
8
9
10
use syntaxmate::Highlighter;

fn main() -> syntaxmate::Result<()> {
    let source = "fn main() { println!(\"<hello>\"); }";
    let mut highlighter = Highlighter::bundled()?;
    let output = highlighter.highlight_html("rust", source, "github-dark")?;
    assert!(output.status().is_complete());
    println!("{}", output.as_str());
    Ok(())
}