shiki
This plugin will enable syntax highlighting for markdown code fence with Shiki (Shikiji).
TIP
Shiki is the syntax highlighter being used by VSCode. It has higher fidelity, but it could be slower than Prism.js, especially when you have a lot of code blocks.
You could consider disabling this plugin in dev mode to get better development experience.
Usage
npm i -D @vuepress/plugin-shiki@next
import { shikiPlugin } from '@vuepress/plugin-shiki'
export default {
plugins: [
shikiPlugin({
// options
langs: ['ts', 'json', 'vue', 'md', 'bash', 'diff'],
}),
],
}
Options
langs
Type:
ShikiLang[]Details:
Languages of code blocks to be parsed by shikiji.
This option will be forwarded to
getHighlighter()method of shikiji.You need to provide the languages list you are using explicitly, otherwise shikiji won't load any languages.
Also see:
theme
Type:
ShikiThemeDefault:
'nord'Details:
Theme of shikiji.
This option will be forwarded to
codeToHtml()method of shikiji.Also see:
themes
Type:
Record<'dark' | 'light', ShikiTheme>Details:
Dark / Light Dual themes of shikiji.
This option will be forwarded to
codeToHtml()method of shikiji.Also see:
