[Experiment] Storybook-to-Markdown Skill Convertor for Wonder Blocks#2967
[Experiment] Storybook-to-Markdown Skill Convertor for Wonder Blocks#2967
Conversation
…tor for Wonder Blocks
🦋 Changeset detectedLatest commit: 49d1b04 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
npm Snapshot: Published🎉 Good news!! We've packaged up the latest commit from this PR (a8ea49b) and published all packages with changesets to npm. You can install the packages in ./dev/tools/deploy_wonder_blocks.js --tag="PR2967"Packages can also be installed manually by running: pnpm add @khanacademy/wonder-blocks-<package-name>@PR2967 |
|
Size Change: 0 B Total Size: 118 kB ℹ️ View Unchanged
|
A new build was pushed to Chromatic! 🚀https://5e1bf4b385e3fb0020b7073c-cftoxhanbs.chromatic.com/ Chromatic results:
|
| @@ -0,0 +1,1956 @@ | |||
| #!/usr/bin/env node | |||
There was a problem hiding this comment.
This is the new script - I have not reviewed this at all.
jandrade
left a comment
There was a problem hiding this comment.
This looks promising, and definitively worth experimenting. I left some initial comments to exclude some pages before giving final approval.
I'm going to be creating a PR to improve a bit the documentation around deprecated components that I'd like to land before this PR gets merged so we don't generate unwanted MD files.
Thanks for working on this!
| const storyFiles = await fg("__docs__/**/*.stories.tsx", { | ||
| cwd: ROOT, | ||
| ignore: [ | ||
| "__docs__/**/*-testing-snapshots.stories.tsx", |
There was a problem hiding this comment.
suggestion: We should also ignore playtesting stories. We use them just to do some internal manual testing (and some interactive testing). For example: https://github.com/Khan/wonder-blocks/blob/main/__docs__/wonder-blocks-tabs/tabs-testing-playtesting.stories.tsx
| cwd: ROOT, | ||
| ignore: [ | ||
| "__docs__/**/*-testing-snapshots.stories.tsx", | ||
| "__docs__/components/**", |
There was a problem hiding this comment.
suggestion: We should also ignore any files that include the deprecated word. For example: tokens/deprecated-color...
There was a problem hiding this comment.
I'm also going to be experimenting with some visual badges (which uses Storybook tags) to be able to filter out deprecated components.
There was a problem hiding this comment.
For some reason, the tool skipped creating the Switch Docs page.
Summary:
This is an experiment to see if we can convert all of our storybook files to passable markdown so that it can then be accessed by a skill (that is then baked into this repo so that folks can install it by running:
npx skills @khan/wonder-blocks).This change was 99.9% created by Claude Code using Opus 4.6, my only change was adding in the
.gitattributesbit to mark the output as generated files.I used these prompts to produce this output:
Now, is this perfect? Definitely not. I have some ideas on how we could improve the code output (making a linter to require all variables to be inline inside all Storybook examples, and then have Claude tackle that work). But I'm wondering if this might be "good enough" for folks to get experimenting?
I also added in a Github workflow so that the files will get regenerated whenever they land on
main. I'm open to other suggestions here!Issue: FEI-XXXX
Test plan:
A cool side effect of this is that you can now browse the docs using tools like Obsidian!