Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add remarkPlugins theme option #821

Merged
merged 2 commits into from
Apr 23, 2020

Conversation

alaaalii
Copy link
Contributor

Add a remarkPlugins option to pass along to gatsby-plugin-mdx.

The reason this is required in addition to the gatsbyRemarkPlugins option is because gatsbyRemarkPlugins has had numerous issues with getting plugins to work with it:

But the remarkPlugins option works great and is usually the workaround that is eventually used. So exposing this option to the user helps.

Changelog

New

  • added a remarkPlugins theme option to be passed to gatsby-plugin-mdx
  • added an example on how to use it with the remark-grid-tables remark plugin

@alaaalii alaaalii requested a review from a team April 22, 2020 20:20
@vercel
Copy link

vercel bot commented Apr 22, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/carbon-design-system/gatsby-theme-carbon/8edxfvzz8
✅ Preview: https://gatsby-theme-carbon-git-fork-alaaalii-add-gatsby-mdx-option.carbon-design-system.now.sh

@ghost ghost requested review from andreancardona and jnm2377 and removed request for a team April 22, 2020 20:21
Copy link
Collaborator

@vpicone vpicone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for this, we don't use remark plugins in our sites so aren't exposed to the issues. Maybe you could add a note for when someone might use one or the other? Even a "if this doesn't work, try this" sort of note.

Just don't want folks to look at gatsbyRemarkPlugins and remarkPlugins and not know which to reach for.

packages/gatsby-theme-carbon/gatsby-config.js Outdated Show resolved Hide resolved
packages/example/src/pages/guides/configuration.mdx Outdated Show resolved Hide resolved
@alaaalii
Copy link
Contributor Author

Thanks. I added this to the documentation:

The gatsbyRemarkPlugins option is compatible with all gatsby-remark-* plugins, for example gatsby-remark-mermaid. If a gatsby remark plugin does not work, you can try calling the (underlying) remark plugin directly using the remarkPlugins option.

Hopefully this wording is good enough to explain the difference?

@vpicone vpicone self-requested a review April 23, 2020 19:58
Copy link
Collaborator

@vpicone vpicone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant fixes, thank you again!

Copy link
Collaborator

@vpicone vpicone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant! Love the clarity you brought to that section of the docs.

@vpicone vpicone merged commit 279bad4 into carbon-design-system:master Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants