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

Components: Prevent generated readmes duplicating h1 elements when published #66180

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

mirka
Copy link
Member

@mirka mirka commented Oct 16, 2024

What?

Fixes an issue with autogenerated component readmes (#66035) that causes a duplicate h1 element when published to the Block Editor Handbook.

Why?

Autogenerated readmes have a duplicated h1 element when published, even though manual readmes also have a h1 element at the top of the markdown and don't get duplicated.

Duplicated

Top of doc page for AlignmentMatrixControl

Non-duplicated

Top of doc page for BaseControl

Turns out, the script that de-duplicates the h1 only works when the very first thing in the markdown file is the h1.

How?

Move the comment down so the h1 can be the first thing in the markdown.

Testing Instructions

We'll see when this is published 🤞

@mirka mirka added the [Type] Developer Documentation Documentation for developers label Oct 16, 2024
@mirka mirka self-assigned this Oct 16, 2024
Copy link

github-actions bot commented Oct 16, 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.

{ h1: typeDocs.displayName },
'<!-- This file is generated automatically and cannot be edited directly. Make edits via TypeScript types and TSDocs. -->',
Copy link
Member Author

Choose a reason for hiding this comment

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

I also appended a note on how to make edits. Especially because there is an "edit link" at the bottom of the Block Editor Handbook pages that points to the readme file.

Edit link that says 'Improve it on GitHub'

@mirka mirka requested a review from a team October 16, 2024 17:41
Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

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

LGTM!

I initially thought about git-ignoring the READMEs, but then realised they're too important in helping navigating the repo — so we should probably keep them around even if they're auto-generated.

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.

LGTM 👍

@mirka mirka enabled auto-merge (squash) October 17, 2024 10:16
@mirka mirka merged commit 6e764be into trunk Oct 17, 2024
73 of 75 checks passed
@mirka mirka deleted the fix/components-docgen branch October 17, 2024 10:31
@github-actions github-actions bot added this to the Gutenberg 19.6 milestone Oct 17, 2024
@cbravobernal cbravobernal added the [Type] Bug An existing feature does not function as intended label Oct 30, 2024
@mirka mirka removed the [Type] Developer Documentation Documentation for developers label Oct 30, 2024
karthick-murugan pushed a commit to karthick-murugan/gutenberg that referenced this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants