Replies: 1 comment
|
There's no direct passthrough for it, VitePress's The escape hatch that does work is // .vitepress/config.ts
import { createHighlighter } from 'shiki'
export default {
markdown: {
theme: { light: 'github-light', dark: 'github-dark' },
async config(md) {
const highlighter = await createHighlighter({
themes: ['github-light', 'github-dark'],
langs: [], // langs get loaded lazily as needed, or list them explicitly
})
md.renderer.rules.fence = (tokens, idx) => {
const token = tokens[idx]
return highlighter.codeToHtml(token.content, {
lang: token.info.trim() || 'text',
themes: { light: 'github-light', dark: 'github-dark' },
defaultColor: false,
})
}
},
},
}With Worth filing as a feature request too, a |
Uh oh!
There was an error while loading. Please reload this page.
Is there an easy way to set Shiki configuration like
defaultColoras a VitePress consumer?All reactions