Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabs: Auto-generate README #68209

Merged
merged 15 commits into from
Jan 2, 2025
Merged

Tabs: Auto-generate README #68209

merged 15 commits into from
Jan 2, 2025

Conversation

mirka
Copy link
Member

@mirka mirka commented Dec 20, 2024

Stacked on #68208

What?

Convert the Tabs README to an auto-generated one.

Supplementary information that was in the existing README is moved to other appropriate locations (JSDocs, Storybook "Best Practices" page).

Why?

To decrease maintenance cost and consolidate the canonical docs for our audience.

Testing Instructions

  • In your IDE, check imports of Tabs.Tab for example, and see that the JSDoc includes the subcomponent description.
  • npm run docs:components to regenerate READMEs.
  • See Storybook docs for Tabs.

@mirka mirka added [Type] Developer Documentation Documentation for developers [Package] Components /packages/components labels Dec 20, 2024
@mirka mirka self-assigned this Dec 20, 2024
@mirka mirka requested a review from ajitbohra as a code owner December 20, 2024 17:43
Copy link

github-actions bot commented Dec 20, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: mirka <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: tyxla <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

packages/components/src/tabs/tab.tsx Outdated Show resolved Hide resolved
* for more info.
*
* @default true
*
* @see https://www.w3.org/WAI/ARIA/apg/patterns/tabpanel/
Copy link
Member Author

Choose a reason for hiding this comment

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

We should avoid @see tags as they are suppressed in Storybook props tables, and don't make sense when displayed unformatted in the auto-generated README.

packages/components/src/tabs/README.md Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Dec 20, 2024

Flaky tests detected in 31a04e1.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12519111570
📝 Reported issues:

Base automatically changed from autogen-readme-spacing to trunk December 20, 2024 22:54
@mirka mirka requested review from ntwb and nerrad as code owners December 20, 2024 22:54
bin/api-docs/gen-components-docs/markdown/index.mjs Outdated Show resolved Hide resolved
packages/components/src/tabs/stories/best-practices.mdx Outdated Show resolved Hide resolved
packages/components/src/tabs/index.tsx Outdated Show resolved Hide resolved
packages/components/src/tabs/README.md Outdated Show resolved Hide resolved
packages/components/src/tabs/README.md Outdated Show resolved Hide resolved
@@ -105,7 +105,6 @@ export type TabListProps = {
};

// TODO: consider prop name changes (tabId, selectedTabId)
// switch to auto-generated README
// compound technique
Copy link
Member Author

Choose a reason for hiding this comment

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

@ciampo Not sure if these TODOs were even meant to be committed 😂 Do you want me to remove the rest, too?

@mirka mirka requested review from tyxla and ciampo December 27, 2024 17:59
Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

Nothing further, looks great 🚀

@mirka mirka merged commit ab89b44 into trunk Jan 2, 2025
67 of 68 checks passed
@mirka mirka deleted the autogen-tabs-readme branch January 2, 2025 07:40
@github-actions github-actions bot added this to the Gutenberg 20.0 milestone Jan 2, 2025
bph pushed a commit to bph/gutenberg that referenced this pull request Jan 8, 2025
* Components: Normalize newlines

* Tabs: Auto-generate README

* Remove redundant JSDocs

* Add "Using `Tabs` with links" section

* Tweak wording

Co-authored-by: Marin Atanasov <[email protected]>

* Tweak wording

Co-authored-by: Marco Ciampini <[email protected]>

* Fix typo

* Regenerate readme

* Fix lists

* Convert code snippets back to tab indentation

* Update readme

* Remove todo item

---------

Co-authored-by: mirka <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: tyxla <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants