EldoranDev / gridsome-plugin-remark-shiki

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

Custom theme option doesn't load #25

Open djmtype opened 2 years ago

djmtype commented 2 years ago

When I try to load a custom theme as demonstrated by the readme, my theme does not get applied.

Instead, I get this message returned to the console: Shiki theme [object Object] could not get loaded.

I also tried adding shiki separately from npm. No luck.

My config looks like this:

const shiki = require("shiki");
const monokaiPro = shiki.loadTheme("./static/monokai-pro.json");

module.exports = {
transformers: {
        remark: {
            externalLinksTarget: "_blank",
            externalLinksRel: ["nofollow", "noopener", "noreferrer"],
            anchorClassName: "icon icon-link",
            plugins: [
                "@silvenon/remark-smartypants",

                "@noxify/gridsome-remark-table-align",
                [
                    "@noxify/gridsome-remark-classes",
                    {
                        table: "table",
                        "tableCell[align=center]": "txt-center",
                        "tableCell[align=right]": "txt-right",
                    },
                ],
                [
                    "gridsome-plugin-remark-shiki",
                    { theme: monokaiPro, skipInline: true },
                ],
            ],
            config: {
                footnotes: true,
            },
        },
    },
}