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

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from
Open

Tabs: Auto-generate README #68209

wants to merge 4 commits into from

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 <0mirka00@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

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.

Comment on lines +87 to +93
- `both`: all arrow keys work.
- `horizontal`: only left and right arrow keys work.
- `vertical`: only up and down arrow keys work.

- Required: No
- Default: `horizontal`
- Type: `"horizontal" | "vertical" | "both"`
- Required: No
- Default: `"horizontal"`
Copy link
Member Author

Choose a reason for hiding this comment

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

The HTML rendering behavior of these "run-on" Markdown lists is not clearly defined, and depending on the renderer can result in a single merged list 😅

@ciampo Any ideas how to address systematically? (I usually just tweak the prop description so it doesn't end in a list item 🙈)

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 not sure I fully understand the scenario that you're describing 🙉 Could you explain it again? 🙏

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, sorry.

Let's say we have a prop description like this:

/**
 * This is my prop description. It has a list:
 *
 * - Foo
 * - Bar
 * - Baz
 */
myProp?: string;

That is going to end up in the README like this:

### `myProp`

This is my prop description. It does three things:

- Foo
- Bar
- Baz

- Type: `string`
- Required: No

Paste that into a Markdown to HTML converter, and it's going to generate random weird HTML for that ambiguously separated list, depending on the converter implementation. There needs to be some content between those two lists for it to render reliably.

Copy link

github-actions bot commented Dec 20, 2024

Flaky tests detected in 4ddf771.
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/12438403211
📝 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
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.

2 participants