nextra icon indicating copy to clipboard operation
nextra copied to clipboard

Using Shiki transformers with Nextra

Open arvinpoddar opened this issue 6 months ago • 0 comments

Hey all, I'm curious if it's possible to use Shiki transformers with Nextra. I'm attempting to use the transformerNotationDiff for my code blocks on my Nextra site. See https://shiki.matsu.io/packages/transformers#transformernotationdiff.

From https://rehype-pretty.pages.dev/, it appears that we should be able to pass a transformers option to rehypePrettyCodeOptions in the next.config.js file:

const withNextra = require('nextra')({
  theme: "nextra-theme-docs",
  mdxOptions: {
    rehypePrettyCodeOptions: {
      theme: "one-dark-pro",
      transformers: [transformerNotationDiff()]

    },
  },

});

module.exports = withNextra()

The site is able to build and run with this config. However, this has no effect on the code blocks using the transformer notation. Are transformers currently supported?

arvinpoddar avatar Aug 23 '24 05:08 arvinpoddar