Languages
Bundled Languages
Language grammars listed below are re-distributed via tm-grammars
into the shiki
package.
Name | ID | Alias | Preview |
---|
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 to this guide.
Special Languages
Plain Text
You can set lang to text
to bypass highlighting. This is useful as the fallback when you receive user specified language that are not available. For example:
txt
import { codeToHtml } from 'shiki'
const html = codeToHtml('console.log("Hello World")', {
lang: 'text',
theme: 'vitesse-light',
})
txt
, plain
are provided as aliases to text
as well.
ANSI
A special processed language ansi
is provided to highlight terminal outputs. For example:
┌ Welcome to VitePress!
│
◇ Where should VitePress initialize the config?
│ ./docs
│
◇ Site title:
│ My Awesome Project
│
◇ Site description:
│ A VitePress Site
│
◆ Theme:
│ ● Default Theme (Out of the box, good-looking docs)
│ ○ Default Theme + Customization
│ ○ Custom Theme
└
Check the raw markdown of code snippet above.