Skip to content

Conversation

@caseyisonit
Copy link
Contributor

@caseyisonit caseyisonit commented Dec 3, 2025

ok I have figured out how to make the doc blocks reusable AND get MDX rendering with functional JSX + Doc blocks

the docblocks have been converted to Spectrum(Docs|Stories) and takes in an argument of the component stories imported * as ComponentStories for of and tag=[overview, usage, a11y, examples]. We can easily extend other tags to this pattern if we see needed as we get to more complex components.

We have a super simple pattern for docs now with component.usage.mdx and component.a11y.mdx. The pattern is also set up for overview and examples tags, but that can be on an as-needed basis or as we progress in garage week. I used progress-circle for most explorations so check it out.

i like having the "description" in the subtitle doc block since most of them are short. it would be nice for components to have a quick blurb defining the component and then expand upon it in the description jsdoc above the meta tag in component.stories.ts. lets chat more about this.

This still remaining to be solved, the tabs hot linking correctly and the toc rendering the active tab. Also i think ive changed my mind on rendering emtpy tabs. I would like to build in logic that if all doc blocks in a section of the DocumentTemplate.mdx return empty or receive the fallback string (two potential approaches) that the tab and tab panel are removed from the autodocs. as well as if there is only the playground story (i.e. status light, asset) for a component that the examples tab does not render, ive found a cool article that had an interesting approach for an idea.

Read: doc blocks and document template blog post

Super stoked the templatizing of docs is working out!! its going to make writing docs soooo much lighter of a lift IMO

@caseyisonit caseyisonit requested review from KBmyer and nikkimk December 3, 2025 03:34
@caseyisonit caseyisonit requested a review from a team as a code owner December 3, 2025 03:34
@changeset-bot
Copy link

changeset-bot bot commented Dec 3, 2025

⚠️ No Changeset found

Latest commit: 28f7478

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

📚 Branch Preview Links

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-5917

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

This template will likely be going away in the future, but for now it's here to help us get started.
<Subtitle />

<sp-tabs id="component-doc-tabs" size="xl" selected="overview" auto label="Component Documentation">
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm thinking we might not need the tabs

Comment on lines 42 to 45
<sp-tab-panel value="examples" style={{ flexDirection: 'column' }}>
<SpectrumDocs tag="examples" />
<Stories />
</sp-tab-panel>
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need an examples section

<sp-tab-panel value="usage" style={{ flexDirection: 'column' }}>
variations

<SpectrumDocs tag="usage" />
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is where we put the examples from our old docs

<sp-tab-panel value="overview" style={{ flexDirection: 'column' }}>
<Description />
<Primary />
<Controls />
Copy link
Contributor

Choose a reason for hiding this comment

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

I would save the controls for last. Just let them see the component and some overall info about when to use.

</sp-tab-panel>
<sp-tab-panel value="api" style={{ flexDirection: 'column' }}>
<ArgTypes />
<ArgTypes />
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is where we have an example with controls and code, so the API is interactive.

@nikkimk nikkimk self-requested a review December 5, 2025 14:40
@nikkimk nikkimk merged commit 054a200 into garage-week/docs-rocks Dec 5, 2025
18 checks passed
@nikkimk nikkimk deleted the caseyisonit/fafo-docs-2 branch December 5, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants