Highlight
Highlighting built for the web.
Register the languages your docs use, highlight synchronously, and ship one compact semantic HTML tree that every theme can share.
The registry is the bundle plan.
The core knows no languages. Direct imports make the site’s language set explicit and let the bundler discard everything else.
Change the palette. Keep the markup.
Tokens carry stable semantic classes instead of theme colors. CSS variables recolor the same tree without a second highlighting pass.
const
</span>
--th-keyword: #a21caf
--th-keyword: #f0abfc
Web languages rarely stay in their lane.
HTML, Vue, Svelte, EJS, and Markdown delegate embedded regions only when the nested language is registered. JavaScript and TypeScript handle their own template interpolation.
const score: number = 0.98
</script>
Web
TS · TSX · JS · JSX · CSS · HTML
Content
Markdown · JSON · YAML · TOML
Shell
Bash · Shell · Zsh
Frameworks
Vue · Svelte · EJS · TSRX (Octane)
Annotate the lesson, not the token stream.
Highlight lines, exact character ranges, insertions, deletions, focus, errors, and warnings without changing the source or tokenizer.
Tuned against the docs it will render.
Release checks cover source preservation, deterministic HTML, bundle sizes, and throughput across more than 10,000 code blocks, including numbered and decorated blocks.
Local measurements from the project benchmark report. Shiki initialization and language loading are measured separately; EJS, ENV, and TSRX use its plaintext fallback. Timings vary by machine, and the tools don’t provide equivalent grammar accuracy.
A docs highlighter is not an editor highlighter.
Highlight is optimized for known web languages and compact page output, not TextMate completeness, automatic detection, 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.
Drop it into Markdown without hiding the language set.
TanStack Markdown, Remark, Rehype, and Octane MDX adapters all take an explicit highlighter, so you control which languages ship.
A serializable document model that keeps highlighting at an explicit boundary.
Explore MarkdownPartners
Sponsors get special perks like private discord channels, priority issue requests, and direct support!