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

JSON Schema Docgen Rework #63639

Merged

Conversation

ajlende
Copy link
Contributor

@ajlende ajlende commented Jul 17, 2024

What?

Reworks the theme.json reference docgen.

Key features include:

  • Descriptions for styles and settings properties.
  • Reworked type serialization to remove the props heading for styles and settings.
  • Better types everywhere in the document.
  • Details for settings and styles.
  • The useRootPaddingAwareAlignments top-level property returns.
  • Cleaner code.

Why?

Split out of #63591 so that both the schema changes and codegen changes can be reviewed independently from one another.

How?

Slow refactoring of the docgen code bit by bit. Check out the commits for details.

Testing Instructions

See that the new docs look correct.

Testing Instructions for Keyboard

N/A

Screenshots or screencast

N/A

@ajlende ajlende added the [Type] Developer Documentation Documentation for developers label Jul 17, 2024
@ajlende ajlende self-assigned this Jul 17, 2024
Copy link

github-actions bot commented Jul 17, 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: ajlende <ajlende@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

@ajlende ajlende force-pushed the update/json-schema-codegen-rework branch from 9199754 to b46fb96 Compare July 17, 2024 03:28
@ajlende ajlende requested a review from t-hamano July 17, 2024 03:32
@ajlende ajlende force-pushed the update/json-schema-codegen-rework branch from 905f014 to e00b140 Compare July 17, 2024 15:29
@ajlende ajlende force-pushed the update/json-schema-codegen-rework branch from e00b140 to 5e8ff42 Compare July 17, 2024 15:44
| --- | --- | --- |--- |
| backgroundImage | boolean | false | |
| backgroundSize | boolean | false | |
| Property | Description | Type | Default |
Copy link
Contributor

Choose a reason for hiding this comment

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

I much prefer these headings.

Copy link
Contributor

@scruffian scruffian left a comment

Choose a reason for hiding this comment

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

This is looking good. I deleted the auto generated section and ran node bin/api-docs/gen-theme-reference.mjs and it restored things as they are.

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM! Compared to previous documents, it is much easier to read, and the document generation logic seems to have been greatly refined.

Here's what the Block Editor Handbook might look like with this PR applied. I tested it by making a temporary change to one table:

61da15d550c203d2cd5e2faa7a76aa84.mp4

@scruffian scruffian merged commit 2bab454 into update/json-schema-cleanup Jul 23, 2024
63 checks passed
@scruffian scruffian deleted the update/json-schema-codegen-rework branch July 23, 2024 08:21
@ajlende ajlende restored the update/json-schema-codegen-rework branch July 23, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
Development

Successfully merging this pull request may close these issues.

3 participants