Skip to content

CSF-tools: Turn story comments into docs descriptions#19684

Merged
shilman merged 9 commits into
shilman/csf-pluginfrom
shilman/csf-plugin-docgen-description
Nov 1, 2022
Merged

CSF-tools: Turn story comments into docs descriptions#19684
shilman merged 9 commits into
shilman/csf-pluginfrom
shilman/csf-plugin-docgen-description

Conversation

@shilman
Copy link
Copy Markdown
Member

@shilman shilman commented Oct 29, 2022

Issue: #8527

Credit to @izhan for paving the way https://github.com/izhan/storybook-description-loader

What I did

Telescopes off #19680

  • Parse out comments that start with /** and add them as docs.description.story parameters
  • Made it a loader so that it receives the original file with comments
  • Preserve user indentation
  • Added plugin options
  • Correctly merge generated parameters with user parameters
  • Made it async for performance

How to test

  • CI passes
  • Test it out in ui storybook or CRA sandbox

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


@shilman shilman force-pushed the shilman/csf-plugin-docgen-description branch from de1296d to 2c4c25d Compare October 29, 2022 13:32
Comment thread code/lib/csf-tools/src/enrichCsf.ts Outdated
Comment thread code/lib/csf-tools/src/enrichCsf.ts Outdated
@shilman shilman changed the title CSF-tools: Turn story comments into docs descriptions WIP CSF-tools: Turn story comments into docs descriptions Oct 31, 2022
@shilman shilman marked this pull request as ready for review October 31, 2022 16:32
Copy link
Copy Markdown
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

Comment thread code/lib/csf-tools/src/enrichCsf.ts Outdated
@shilman shilman merged commit 75f1cb6 into shilman/csf-plugin Nov 1, 2022
@shilman shilman deleted the shilman/csf-plugin-docgen-description branch November 1, 2022 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants