question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[addon-docs] Add support for providing remark plugins in docs

See original GitHub issue

Is your feature request related to a problem? Please describe. See the twitter discussion I had with @shilman.

Currently if the user wants to add new remark plugins to docs, they have to manually create the loader in conjunction with createCompiler, as seen in the doc.

const createCompiler = require('@storybook/addon-docs/mdx-compiler-plugin');
const emoji = require("remark-emoji");

{
  loader: "@mdx-js/loader",
  options: {
    compilers: [createCompiler({})],
    remarkPlugins: [emoji] // <--
  }
}

Describe the solution you’d like We can add a new option in addon-docs to add the remarkPlugins (and other loader options) to the mdx loader, called mdxLoaderOptions.

const emoji = require("remark-emoji");

module.exports = {
  addons: [
    {
      name: "@storybook/addon-docs",
      options: {
        mdxLoaderOptions: {
          remarkPlugins: [emoji] // <--
        }
      }
    }
  ]
};

Currently we already have 2 default remark plugins. We can just simply override the options and expect the users to add them back if they still want those plugins.

Describe alternatives you’ve considered We could dedup the provided plugins, but that might be a bad idea.

Are you able to assist bring the feature to reality? Sure! 😃 Any heads-up for where to look into?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
frassiniercommented, Apr 21, 2021

And FWIW there is a simple workaround for now https://twitter.com/frassinier/status/1381581824699273222

2reactions
shilmancommented, Jan 16, 2020

I think adding an mdxLoaderOptions to the docs preset would be 💯! cc @patricklafrance

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docs Addon | Storybook: Frontend workshop for UI development
DocsPage is a zero-config aggregation of your component stories, text descriptions, docgen comments, props tables, and code examples into clean, readable pages.
Read more >
Allow or restrict add-ons in Docs editors - Google Support
Allow or restrict add-ons in Docs editors ... You (and your users) can use add-ons in Google Docs, Sheets, Slides, and Forms to...
Read more >
@storybook/addon-docs | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
@storybook/addon-docs - npm Package Health Analysis | Snyk
Learn more about @storybook/addon-docs: package health score, popularity, ... in your projects for vulnerabilities and provides automated fix advice.
Read more >
Storybook addon-docs MDX does not work on Edge
My team has implemented Storybook for our React components, and the addon-docs plugin has been added to allow the developers to document the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found