-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Addon-docs: DocsPage "slots" #7456
Comments
👍 Seems like the right balance of "It Just Works", customizability, and maintenance burden. |
Would definitely like to see some documentation examples of how you can add blocks in your own MDX. For example, I was messing with this. import {Button} from '@storybook/react/demo';
import {Story, Meta, Props} from '@storybook/addon-docs/blocks';
<Meta title="MDX|Button" component={Button} />
# Hello Docs
Welcome to the future of Storybook!
<Story name="hello">
<Button>Hello button!</Button>
</Story>
<Props of={Button} /> It'd also be cool to expose a way to have color formatted code like the story previews. Or can you use And was able to get close messing around with the preview (p.s. loving the props table!) Notice the font is wrong in the preview though, thinking that relates to #7264. |
@leerob Thanks! I think your questions are more about MDX than about To clarify:
5.2 will introduce and document In 5.3 we will refine and document MDX and come up with best practices for that, and that will be the "docs" focus of the release. RE: highlighting code blocks #7162. You'll just use regular GFM code blocks and docs will do the rest for you. It's an easy feature actually but I'm just hustling to get the 5.2 release out the door so I haven't gotten around to it. In the meantime you can use the RE: including your own components in MDX, just import them! As for |
Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-beta.24 containing PR #7680 that references this issue. Upgrade today to try it out! You can find this prerelease on the Closing this issue. Please re-open if you think there's still more to do. |
Should mdx files be automatically decorated by |
MDX is an alternative to DocsPage. DocsPage takes all your stories and turns them into documentation. MDX takes your documentation and turns it into stories (roughly). If you're writing MDX containing |
Ah ok, thanks. For me everything is working as intended. I just had the feeling that there would be a way to automatically generate <Meta title='Button' component={Button} />
<Story name="Test">
<Button />
</Story> export default {
title: 'Button',
component: Button,
};
export const Test = () => <Button />; |
Great Caesar's ghost!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-beta.29 containing PR #7741 that references this issue. Upgrade today to try it out! You can find this prerelease on the |
Problem
Current version of DocsPage tries to do a bunch of stuff automatically for you based on existing
addon-notes
/addon-info
/docgen
annotations. This can result in weird behavior depending on how you set up your storybook.Solution
The idea is that we give you a minimal experience out of the box that looks good, and then we help you get to a great page with as little extra work as possible.
The text was updated successfully, but these errors were encountered: