Storybook创建一个隐藏的故事,以便包含在mdx文档中。

huangapple go评论68阅读模式
英文:

Storybook create a hidden story to be included in mdx docs

问题

我正在为Storybook中的一个复杂组件创建文档,并希望在mdx文件中创建一个工作示例。通常,我的做法是使用Story标记将一个故事集成到我的mdx中。
是否有一种方式可以创建一个故事以集成到我的mdx中,但不会在侧边栏中与其他故事可见?我正在使用Storybook 7,我的组件是使用Vue制作的(尽管我认为这与问题无关)。

英文:

I'm creating documentation for a complex component in Storybook and would like to create a working example inside an mdx file. To do this my approach is usually to integrate a story into my mdx using the Story tag.
Is there a way to create a story to bo integrated into my mdx but without it being visible with the other stories in the sidebar?

I am using storybook 7 and my components are made with vue (although I think this is irrelevant).

答案1

得分: 0

我已经将一个 display:none 规则添加到 manager-head.html 文件中的侧边栏按钮(通过它们的 id)在 .storybook 文件夹中。

英文:

For anyone looking for a solution to this question, I ended up with the followind solution:

I have added a display:none rule to sidebar buttons (by their id) in the manager-head.html file in the .storybook folder.

huangapple
  • 本文由 发表于 2023年6月13日 17:14:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76463371.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定