-
-
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: Configurable Source snippetization #7479
Comments
Perhaps adding an option globally to pass each UI pattern through a transformer would be a good approach. |
Hello, |
@alazurenko yeah, good chance of that! |
Hey! I see it's not listed on the top here, but I saw it mentioned in a comment on dischord; that this fix might let us show html markup from rendered react components. Do you know if this will make it in? When will 5.3.0 ship? Will it be on a @next tag sometime soon perhaps..? |
Is this now available in the 5.3.0-beta? I'd really like to try it! How do I get it to show both the React markup and the HTML markup? |
I hate to nag, I know you guys have loads of stuff to sort out before 5.3 release. My deadline is closing in on me fast, any idea when this will be tackled? |
In our case, we cheated and would love an official way to provide a custom source snippet:
Event better would be to be able to customize the source component used in the docs page. |
@hsablonniere you might be able to hack in your own component today: We should also provide better source snippetization in 6.0 (knock wood) |
@shilman I think I already tried those, does it laso work for DocsPage generated from CSF files? |
@hsablonniere Aha unfortunately not. We'll do our best to get you a good solution in the next release cycle. |
@shilman Are there any outstanding things that need to be done to move this forwards? I would love to help out where possible. |
You can use <Preview mdxSource={`
<v-icon name="accessibility_new" color="--red" x-small />
<v-icon name="warning" color="--purple" small />
<v-icon name="gesture" color="--blue" />
<v-icon name="security" color="--green" large />
<v-icon name="person" color="--orange" x-large />
`}> Full example<Preview mdxSource={` <v-icon name="accessibility_new" color="--red" x-small /> <v-icon name="warning" color="--purple" small /> <v-icon name="gesture" color="--blue" /> <v-icon name="security" color="--green" large /> <v-icon name="person" color="--orange" x-large /> `}> <Story name="x-small" height="50px"> {{ components: { VIcon }, template: `<v-icon name="accessibility_new" color="--red" x-small />` }} </Story> <Story name="small" height="50px"> {{ components: { VIcon }, template: `<v-icon name="warning" color="--purple" small />` }} </Story> <Story name="default" height="50px"> {{ components: { VIcon }, template: `<v-icon name="gesture" color="--blue" />` }} </Story> <Story name="large" height="50px"> {{ components: { VIcon }, template: `<v-icon name="security" color="--green" large />` }} </Story> <Story name="x-large" height="50px"> {{ components: { VIcon }, template: `<v-icon name="person" color="--orange" x-large />` }} </Story> </Preview> Warning: adding multiple |
@rijkvanzanten that's pretty sweet!! not what i had in mind, but effective! 💯 |
I'm Hamham on Discord and to clarify on what I want, I would just like plain HTML output for storybook-html. It'd be cool if it could also generate the rendered HTML affected by the knobs . Thanks for all you guys do at Storybook! |
Forgive me for butting in here without doing a whole lot of research, but would this workaround be feasible to use with Angular? I thought I remembered reading somewhere that MDX is available now for Angular, but I can't remember where and can't find it now. |
@dannymcgee MDX has been available for all storybook supported frameworks from the start. Documentation is catching up with the code, but check the addon-docs README for angular and also examples/angular-cli in the storybook repo |
Gadzooks!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.22 containing PR #10084 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. |
Almost there. Next release will get it over the line. 😅 |
Egads!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.24 containing PR #10089 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. |
¡Ay Caramba!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.28 containing PR #10184 that references this issue. Upgrade today to try it out! You can find this prerelease on the |
@shilman is there an example to just load the code inside the |
@absalonv i've seen one for vue |
Add the ability to configure Source block with per-framework snippetization, or even user-configurable snippetization. E.g.
template:
field for Angularetb
(?) wants to remove the() => ...
HamHam
wants to remove single quotes from:The text was updated successfully, but these errors were encountered: