EldoranDev / gridsome-plugin-remark-shiki

Syntax highlighter for markdown code blocks using shiki
15 stars 8 forks source link

Doesn't work with gridsome-vue-remark #16

Closed D-Marc1 closed 4 years ago

D-Marc1 commented 4 years ago

I have the following configuration, but it's not adding syntax highlighting to my code. Am I doing something wrong?

module.exports = {
  plugins: [
    {
      use: '@gridsome/vue-remark',
      options: {
        typeName: 'BlogPost', // Required
        baseDir: './blog/posts', // Where .md files are located
        template: './src/templates/BlogPost.vue', // Optional
        remark: {
          plugins: [
            [
              'gridsome-plugin-remark-shiki',
              { theme: 'nord', skipInline: false },
            ],
          ],
        },
      },
    },
  ],
};
EldoranDev commented 4 years ago

Nothing wrong on the first look, I'll check deeper later today.

EldoranDev commented 4 years ago

okay, apparently the configuration for vue-remark and the transformer-remark are differnt.

The plugin config needs to get moved into the plugin config as the there listed plugins are used by the vue-remark.

module.exports = {
  plugins: [
    {
      use: '@gridsome/vue-remark',
      options: {
        typeName: 'BlogPost', // Required
        baseDir: './blog/posts', // Where .md files are located
        template: './src/templates/BlogPost.vue', // Optional
       plugins: [
          [
            'gridsome-plugin-remark-shiki',
            { theme: 'nord', skipInline: false },
          ],
        ],
     },
    },
  ],
};
D-Marc1 commented 4 years ago

Thank you for the quick reply! I did make an error in the syntax as you pointed out also. I updated the original comment to place remark inside options.

I'm not sure why Gridsome made these plugins so much different when they actually made them both and accomplish the same task, only vue-remark can do much more

D-Marc1 commented 4 years ago

@EldoranDev wait, I'm confused. Why was this issue closed? Doesn't this still not work?

D-Marc1 commented 4 years ago

Oh wait, nvm. I'm an idiot, my apologies. I didn't realize the remark outer layer was removed in your comment. Thanks again!