Languages
Bundled Languages
Language grammars listed below are re‑distributed via tm-grammars into the shiki package.
| Name | ID | Alias | Preview |
|---|---|---|---|
Note
Grammars are covered by their repositories’ respective licenses, which are permissive (apache‑2.0, mit, etc), and made available in this NOTICE.
For loading your custom languages, please reference the guide.
Special Languages
Plain Text
You can set lang to text to bypass highlighting. This is useful as the fallback when you receive a user‑specified language that is not available. For example:
import { codeToHtml } from 'shiki'
const html = codeToHtml('console.log("Hello World")', {
lang: 'text', // [!code hl]
theme: 'vitesse-light',
})
txt and plain are provided as aliases to text as well.
ANSI
A special processed language ansi is provided to highlight terminal outputs. For example:
colored foreground
colored background
bold text
dimmed text
underlined text
reversed text
strikethrough text
underlined + strikethrough text
Check the raw markdown of code snippet above.