diff --git a/docs/content/4.plugins/1.built-in/rangi.md b/docs/content/4.plugins/1.built-in/rangi.md index f656f353..e500615e 100644 --- a/docs/content/4.plugins/1.built-in/rangi.md +++ b/docs/content/4.plugins/1.built-in/rangi.md @@ -1,6 +1,6 @@ --- title: Rangi (Highlight) -description: Lightweight syntax highlighting for code blocks using rangi. +description: Lightweight syntax highlighting for code blocks and language-tagged inline code using rangi. seo: title: Syntax Highlighting using Rangi navigation: @@ -146,6 +146,22 @@ const tokens = tokenize(source, { Rangi ships aliases built-in (`javascript`→`js`, `typescript`→`ts`, `python`→`py`, `yml`→`yaml`, …). Comark passes the fence info string straight through. Unknown languages fall back to plain text (no throw). +### Inline code + +Inline code is highlighted when it declares a language with the attributes syntax. `lang` wins over `language`: + +```markdown +The type is `Ref`{lang="ts-type"} and the component is ``{lang="vue-html"}. +``` + +Two fragment languages ship out of the box: `ts-type` tokenizes through the TypeScript grammar seeded with `let a:`, and `vue-html` through the Vue grammar seeded with `