emulsify-ds / emulsify-drupal

Drupal theme built with Storybook and Webpack
GNU General Public License v2.0
91 stars 42 forks source link

ArgsTable and custom source code for component preview in MDX file #235

Closed mhlozek closed 2 years ago

mhlozek commented 2 years ago

Hi, I am new to emulsify and I am just discovering what is possible/impossible. So I have two questions:

1) I want to document my components with mdx file and show this documentation in Storybook's Docs tab. Is it possible to insert ArgsTable? See https://storybook.js.org/docs/react/writing-docs/doc-blocks#argstable

2) I would like to customize source code generated for Story in mdx file. It should be possible with

parameters={{
            docs: {
                source: {
                    code: ...

but it does not work for me in Emulsify.

Thanks for your help and tips!

ModulesUnraveled commented 2 years ago

Hi! Emulsify itself doesn't create any restrictions on what you can do. It's basically just a Storybook install with Drupal stuff added.

If you're using one of the most recent releases, we removed the docs Storybook addon, since it isn't something the majority of people use, but if you want to use it, you should just be able to install it, and start using it.

npm install --save-dev @storybook/addon-docs should get you going.

Here's the npm page for more info. https://storybook.js.org/addons/@storybook/addon-docs

If adding that doesn't solve it for you, see if there's another Storybook addon that solves your issue. And feel free to re-open if you think something in Emulsify is preventing you from getting your work done.