arborium-highlight
Core syntax highlighting engine for arborium.
Features
This crate provides the unified highlighting engine that works with both:
- Statically linked Rust grammars: For CLI tools and servers
- Dynamically loaded WASM plugins: For browser contexts
Why Async?
The parsing is synchronous (tree-sitter fundamentally is), but getting a grammar
can be async in browser contexts where plugins are loaded from a CDN via dynamic
import(). The async trait supports both use cases with the same API.
Usage
use ;
// After getting spans from a grammar...
let html = spans_to_html;
Part of the arborium project. See arborium.bearcove.eu for more information.