Rich text / foldkit-richtext-code-shiki

foldkit-richtext-code-shiki

Shiki's grammars as tokenizers for a foldkit-richtext CodeBlock.

A code block's document holds its language and plain text; what a highlighter finds there is a set of decorations, derived for a render and discarded (RichText.codeDecorations). This package turns a Shiki highlighter the application already made into those tokenizers — one per language it loaded — so TypeScript, CSS, Python, or anything else Shiki has a grammar for highlights the way foldkit-richtext-code's JSON grammar does.