Gatsby: setParserPlugins doesn't take plugin options

Created on 20 Dec 2017  Â·  3Comments  Â·  Source: gatsbyjs/gatsby

Description

I'm trying to use remark-custom-blocks. However I am unable to find a way to pass in required plugin options. I looked at #706 but still no luck.

See how the plugin is used below

  remark.use(remarkCustomBlocks, {
    someType: 'a-css-class another-class',
    anotherType: 'foo',
  })

I have tried the following, but no luck unfortunately

module.exports.setParserPlugins = () => [
  function customRemark() {
    return remarkCustomBlocks({
      danger: 'danger',
      info: 'info',
    });
  },
];

Is there a way to pass parser option arguments?

Perhaps we could change https://github.com/gatsbyjs/gatsby/blob/dcfa0fab32e168c075c052dde7ecd97736c6147a/packages/gatsby-transformer-remark/src/extend-node-type.js#L63 to also take parser plugin options?

Environment

Gatsby version: 1.1.20
Node.js version: v8.5.0

Most helpful comment

Hey sure! That totally makes sense and seems like it was an oversight not adding that originally.

Would you like to create a PR for this?

A plugin for remark-custom-blocks would be 💯 too :-)

All 3 comments

Hey sure! That totally makes sense and seems like it was an oversight not adding that originally.

Would you like to create a PR for this?

A plugin for remark-custom-blocks would be 💯 too :-)

Absolutely :). I'll work on a PR tonight.

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brandonmp picture brandonmp  Â·  3Comments

KyleAMathews picture KyleAMathews  Â·  3Comments

signalwerk picture signalwerk  Â·  3Comments

theduke picture theduke  Â·  3Comments

hobochild picture hobochild  Â·  3Comments