Tech News
← Back to articles

Arborium: Tree-sitter code highlighting with Native and WASM targets

read original related products more articles

Add to your Cargo.toml :

Script tag (zero config)

Add this to your HTML and all

 blocks get highlighted automatically:

< script src =" https://cdn.jsdelivr.net/npm/@arborium/arborium@1/dist/arborium.iife.js " >

Your code blocks should look like this:

< pre >< code class =" language-rust " > fn main() {} < pre >< code data-lang =" rust " > fn main() {} < pre >< code > fn main() {}

Configure via data attributes:

< script src =" ... " data-theme =" github-light " data-selector =" pre code " data-manual data-cdn =" unpkg " >

With data-manual , call window.arborium.highlightAll() when ready.

See the IIFE demo →