Syntax highlighter for markdown code blocks using shiki
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.eslintrc.js
.gitignore
.travis.yml
README.md
index.js
package-lock.json
package.json
yarn.lock

README.md

gridsome-plugin-remark-shiki

Syntax highlighter for markdown code blocks using shiki

Install

  • yarn add gridsome-plugin-remark-shiki
  • npm install gridsome-plugin-remark-shiki

Usage

Add syntax highlighter to a single markdown source using the given options:

{
  // Can be any of
  // https://github.com/octref/shiki/tree/master/packages/themes
  // and will default to 'nord'
  theme: 'nord'
}
module.exports = {
  plugins: [
    {
      use: '@gridsome/source-filesystem',
      options: {
        path: 'blog/**/*.md',
        route: '/blog/:year/:month/:day/:slug',
        remark: {
          plugins: [
            [ 'gridsome-plugin-remark-shiki', { theme: 'nord' } ]
          ]
        }
      }
    }
  ]
}

Add syntax highlighter to all markdown sources:

module.exports = {
  plugins: [
    {
      use: '@gridsome/source-filesystem',
      options: {}
    }
  ],

  transformers: {
    remark: {
      plugins: [
        [ 'gridsome-plugin-remark-shiki', { theme: 'nord' } ]
      ]
    }
  }
}