Arborium: Tree-sitter code highlighting with Native and WASM targets
a day ago
- #syntax-highlighting
- #webassembly
- #tree-sitter
- Arborium provides hand-picked tree-sitter grammars with updated highlight queries and WASM compatibility.
- Includes custom HTML elements for compact markup without JavaScript, e.g., `<a-k>` for keywords.
- Supports 24-bit true color ANSI highlighting for terminal applications.
- Works across macOS, Linux, Windows, and WebAssembly with a provided sysroot for WASM compatibility.
- Enables syntax highlighting in rustdoc via integration or post-processing with `arborium-rustdoc`.
- Offers syntax highlighting for miette error diagnostics in CLI applications.
- Features an incremental static site generator with live updates, Sass/SCSS, image processing, and font subsetting.
- Includes 96 languages behind feature flags, each with license information.
- Supports themes for both HTML and ANSI output, with bundled themes like Ayu, GitHub, Nord, and more.
- Allows custom themes using RGB colors and style attributes, with semantic HTML elements for styling.
- Each grammar embeds the full tree-sitter runtime in WASM, optimized for size but with inherent overhead.
- Compiles with aggressive optimizations: panic=abort, LTO, single codegen unit, and Binaryen's `-Oz`.
- Tree-sitter provides accurate parsing by building syntax trees, unlike regex-based highlighters.
- The name 'Arborium' reflects its purpose as a collection of tree-sitter grammars.
- Open to community contributions for new grammars, provided they meet quality standards.
- Enables full-stack Rust with consistent dependencies across native and WASM targets.
- Tree-sitter uses LR parsing with large state tables for accurate and resilient parsing.