Highlighting that knows it is going into a webpage.
Register the languages your docs use, highlight synchronously, and ship one compact semantic HTML tree that every theme can share. No editor engine or initialization phase required.
2.1 ThousandTotal Downloads268Weekly Downloads2GitHub StarsThe core knows no languages. Direct imports make the site’s language set explicit, keep missing languages visible, and let the bundler discard everything else.
Tokens carry stable th-* classes instead of theme colors. CSS variables recolor the same tree, so dark mode does not require a second highlighting pass or a second copy of the HTML.
HTML, Vue, Svelte, EJS, Markdown, and JavaScript templates embed other languages. Highlight delegates those regions only when the nested language is registered, while preserving every source character around them.
TS · TSX · JS · JSX · CSS · HTML
Markdown · MDX · JSON · YAML
Bash · Shell · PowerShell
Vue · Svelte · Astro · EJS
Highlight lines, exact character ranges, insertions, deletions, focus, errors, and warnings. Decorations split token boundaries cleanly without changing the underlying source or tokenizer.
The committed corpus samples 333 fixtures from 2,940 TanStack documentation files. Release checks cover token fidelity, deterministic HTML, bundle profiles, and at least 10,000 blocks per runtime run.
Project benchmark report. This measures the tested corpus and output shape, not equivalent grammar accuracy; Shiki targets deeper TextMate fidelity.
Highlight is optimized for known web languages and compact page output. It deliberately does not chase TextMate completeness, automatic detection, hundreds of languages, or incremental editor state.
Known docs languages, compact HTML, CSS themes, and annotations matter most.
TextMate and VS Code fidelity, broad language coverage, and editor-grade themes are the job.
The smallest straightforward JavaScript and TypeScript path is enough.
Use the direct renderer, a structured remark adapter, an idempotent rehype adapter, or the Octane MDX path. Every adapter receives the highlighter you assembled; none imports every language behind your back.
A serializable document model that keeps code highlighting at an explicit boundary.
Language scanners, embedded delegation, renderer output, adapters, and bundle profiles are checked against the same committed corpus.
Register. Highlight. Ship.