gridsome-plugin-remark-shiki
Syntax highlighter for markdown code blocks using shiki
Install
yarn add gridsome-plugin-remark-shikinpm install gridsome-plugin-remark-shiki
Usage
Add syntax highlighter to a single markdown source using the given options:
moduleexports = plugins: use: '@gridsome/source-filesystem' options: path: 'blog/**/*.md' route: '/blog/:year/:month/:day/:slug' remark: plugins: 'gridsome-plugin-remark-shiki' theme: 'nord' skipInline: false
Add syntax highlighter to all markdown sources, but skip inline code:
moduleexports = plugins: use: '@gridsome/source-filesystem' options: {} transformers: remark: plugins: 'gridsome-plugin-remark-shiki' theme: 'nord' skipInline: true
Use custom themes with the syntax highlighter:
const shiki = const customTheme = shiki moduleexports = plugins: use: '@gridsome/source-filesystem' options: path: 'blog/**/*.md' typeName: 'Post' remark: plugins: 'gridsome-plugin-remark-shiki' theme: customTheme skipInline: true
Use with @gridsome/vue-remark:
moduleexports = plugins: use: '@gridsome/vue-remark' options: typeName: 'BlogPost' baseDir: './blog/posts' template: './src/templates/BlogPost.vue' plugins: 'gridsome-plugin-remark-shiki' theme: 'nord' skipInline: true ;