#JSDoc tags not parsed

2 messages · Page 1 of 1 (latest)

peak kelp
#

JSDoc is a fairly standard way of annotating documentation. (https://jsdoc.app/) Some of the tags are already parsed by Storybook (e.g. @default), but most of the tags are ignore. They are not even included on the story page as plain text, simply excluded.

  /**
   * XYZ
   * 
   * @example
   * // three equal columns
   * <Grid columns={3} />
   * // first column is 80px, second one takes up all remaining space
   * <Grid columns="80 1fr" />
   *
   * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns
   */
  columns?: string | number;

I'll attach an image how it looks like in VS Code and in Stoybook.

Since you're parsing @default already, I assume there's a way to extend this. If someone can give me a head start I can try to take a look at this. Or if it's already on your roadmap, please link a GH issue, would love to see progress on this.

Thanks!

remote jewel
#

@peak kelp See here, our JSdoc parser:
https://github.com/storybookjs/storybook/blob/f2f280cca22ff0ed06b4fa1341dc47eda4fee9f4/code/lib/docs-tools/src/argTypes/jsdocParser.ts#L1-L252

If you'd like to add support for some fields, I think that would be welcome.

GitHub

Storybook is a frontend workshop for building UI components and pages in isolation. Made for UI development, testing, and documentation. - storybook/code/lib/docs-tools/src/argTypes/jsdocParser.ts...