storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
83.96k stars 9.22k forks source link

[Bug] Svelte component documentation isn't added to autodocs documentation #23904

Open Masstronaut opened 1 year ago

Masstronaut commented 1 year ago

Describe the bug

Following the official svelte component documentation guidelines doesn't result in the autodocs generated page having documentation for the component.

Steps to reproduce the behavior

  1. Create a svelte component
  2. Document it in the officially recommended format
  3. enable autodocs
  4. run storybook and look at the generated autodocs for it. Note that the component description is not present.

Expected behavior

The same markdown documentation used for the officially recommended method of documenting a component should also be provided to the autodocs for any svelte stories.

Screenshots and/or logs

Example of the commented documentation working within VSCode: image

Example of the autodoc-generated documentation not containing that same information:

image

Environment

Additional context

This issue, along with storybookjs/addon-svelte-csf#122 would go a long way towards improving the storybook docs experience for Svelte.

JReinhold commented 1 year ago

@Masstronaut I've transferred this issue from the storybookjs/addon-svelte-csf to the main storybook repo, since I believe this is unrelated to the addon but a feature in the Storybook renderer itself that is missing.

j3rem1e commented 1 year ago

Afaik it's related to how sveldoc-parser extracts the documentation. The description should be before @component, not after.