Storybook: 在故事书中显示文档

创建于 2016-04-26  ·  3评论  ·  资料来源: storybookjs/storybook

目前显示文档的唯一方法是使用:

storiesOf('Main story', module)
  .add('some configuation, () => (
    <SomeComponent />
  )).(...)

这对于我们的大多数组件来说是不够的......

在我们的用例中,如果我们:

  1. 可以添加更多描述(例如故事的可选描述标签)
storiesOf('Main story', module, 'This component can be used to ... and has the following params ...')
  .add('some configuation, () => (
    <SomeComponent />
  )).(...)
  1. 或者甚至更好地以某种方式读取 js 文件中的 jsdoc 并将它们显示在组件示例上方:
/**
 * Represents a book.
 * <strong i="16">@constructor</strong>
 * <strong i="17">@param</strong> {string} title - The title of the book.
 * <strong i="18">@param</strong> {string} author - The author of the book.
 */

我认为这与 #56 有某种关系,但并不完全相同。

问候,
卢卡斯

feature request

最有用的评论

我更喜欢组件文件夹中的 .md 文件,在下面或旁边呈现。

所有3条评论

是的。 这很棒。
如果我们手动需要文件系统,那会有点困难和复杂。
但是,我认为用故事推动这一点是有道理的。

我们也在寻找带有注释的东西。 基本上,我们在底部有另一个名为“注释”的标签。

我更喜欢组件文件夹中的 .md 文件,在下面或旁边呈现。

用这个插件修复

此页面是否有帮助?
0 / 5 - 0 等级