-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
base: trunk
Are you sure you want to change the base?
Tabs: Auto-generate README #68209
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
* for more info. | ||
* | ||
* @default true | ||
* | ||
* @see https://www.w3.org/WAI/ARIA/apg/patterns/tabpanel/ |
There was a problem hiding this comment.
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.
Flaky tests detected in 20fc6d1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12506584582
|
import { Tabs } from '@wordpress/components'; | ||
|
||
const onSelect = ( tabName ) => { | ||
console.log( 'Selecting tab', tabName ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we intentionally using 2 spaces instead of a single tab here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me personally, yes. I find it very hard to read those tabbed code snippets in places where the tab width is fixed at 8 spaces 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it quite the opposite FWIW. I'm used to 4-space tabs and what I'm seeing here feels so packed 😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok my brain exaggerated, everywhere I perceived as tab width 8 ("super wide!") was just 4 😂
- Block Editor Handbook: 4
- Storybook: 4
- GitHub Markdown Preview: 4
The only objective reasoning I can think of to prefer 2 spaces is because the automatic code snippets in Storybook use that (and is not configurable).
I'm fine with unifying back to tabs. That is what our codebase mandates, after all 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅 Thanks, yes, unifying back to tabs makes sense.
@@ -1,254 +1,216 @@ | |||
# Tabs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repeated from https://github.com/WordPress/gutenberg/pull/68249/files#r1895926109 — Tabs
is currently a private API, but there's no mention of this in the README. Should we add a way to flag that in the generated README?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposed in #68317
Co-authored-by: Marin Atanasov <[email protected]>
Co-authored-by: Marco Ciampini <[email protected]>
# Conflicts: # bin/api-docs/gen-components-docs/markdown/index.mjs
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
Tabs.Tab
for example, and see that the JSDoc includes the subcomponent description.npm run docs:components
to regenerate READMEs.