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

Minor updates to theme.json schema pages #50742

Merged
merged 3 commits into from
May 19, 2023

Conversation

mburridge
Copy link
Contributor

What?

Adds some minor updates to the pages for Theme.json v1 and v2, including changing the page titles to improve findability when searching for the schemas.

Also adds an example of usage of "$schema" and "version" properties.

Why?

Closes #47797
Closes #47796

How?

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

@mburridge mburridge added [Type] Developer Documentation Documentation for developers Developer Experience Ideas about improving block and theme developer experience labels May 18, 2023

This reference guide lists the settings and style properties defined in the theme.json schema. See the [theme.json how to guide](/docs/how-to-guides/themes/theme-json.md) for examples and guide on how to use the theme.json file in your theme.
This reference guide lists the settings and style properties defined in the `theme.json` schema. See the [theme.json how to guide](/docs/how-to-guides/themes/theme-json.md) for examples and guidance on how to use the `theme.jso`n file in your theme.
Copy link
Contributor

@justintadlock justintadlock May 18, 2023

Choose a reason for hiding this comment

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

backtick character in wrong place. Should be theme.json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doh! 🤦‍♂️ Fixed it.

@@ -1,16 +1,27 @@
# Version 2 (living reference)
# Theme.json Version 2 (living reference)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need "(living reference)" here. It feels redundant. At the very least we could update to just "Reference" to match the title of the other doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed 👍

Comment on lines +20 to +21
"version": 2,
...
Copy link
Member

Choose a reason for hiding this comment

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

Can these lines be indented to match the line above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought I'd already done that 🤷‍♂️ - it looks fine in my editor.

Copy link
Member

Choose a reason for hiding this comment

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

This has happened to me before as well. Coping and pasting the exact spacing to each line will usually fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I adjusted the spacing anyway to ensure consistency and ensure that one line isn't tabbed and the other has multiple spaces.

It can be difficult to remember the theme.json settings and properties while you develop, so a JSON scheme was created to help. The schema is available at https://schemas.wp.org/trunk/theme.json
It can be difficult to remember the `theme.json` settings and properties while you develop, so a JSON scheme was created to help. The schema is available at https://schemas.wp.org/trunk/theme.json

Code editors can pick up the schema and can provide help like tooltips, autocomplete, or schema validation in the editor. To use the schema in Visual Studio Code, add "$schema": "https://schemas.wp.org/trunk/theme.json" to the beginning of your theme.json file together with a "version" corresponding to the version you wish to use, e.g.:
Copy link
Member

Choose a reason for hiding this comment

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

I think "$schema": "https://schemas.wp.org/trunk/theme.json" and "version" can be placed in backticks since they are code.


## Schema

It can be difficult to remember the theme.json settings and properties while you develop, so a JSON scheme was created to help. The schema is available at https://schemas.wp.org/trunk/theme.json
It can be difficult to remember the `theme.json` settings and properties while you develop, so a JSON scheme was created to help. The schema is available at https://schemas.wp.org/trunk/theme.json
Copy link
Member

Choose a reason for hiding this comment

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

I think "JSON scheme" should be "JSON schema". Also I think we should try and avoid raw links in the docs. Perhaps update to:

Remembering the theme.json settings and properties while you develop can be difficult, so a JSON schema was created to help.

@mburridge mburridge requested a review from ndiego May 18, 2023 18:23
@carolinan carolinan merged commit a8da93f into WordPress:trunk May 19, 2023
@github-actions github-actions bot added this to the Gutenberg 15.9 milestone May 19, 2023
@mburridge mburridge deleted the docs/living-reference-update branch May 19, 2023 08:36
westonruter added a commit that referenced this pull request May 19, 2023
…dd/static-closures

* 'trunk' of https://github.com/WordPress/gutenberg: (26 commits)
  Add transparent outline to input control BackdropUI focus style. (#50772)
  Added wrapper element for RichText in File block (#50607)
  Remove the experimental flag of the command center (#50781)
  Update the document title in the site editor to open the command center (#50369)
  Remove `unwrap` from transforms and add `ungroup` to more blocks (#50385)
  Add new experimental version of DropdownMenu (#49473)
  Force display of in custom css input boxes to LTR (#50768)
  Polish experimental navigation block (#50670)
  Support negation operator in selectors in the Interactivity API (#50732)
  Minor updates to theme.json schema pages (#50742)
  $revisions_controller is not used. Let's delete it. (#50763)
  Remove OffCanvasEditor (#50705)
  Mobile - E2E test - Update code to use the new navigateUp helper (#50736)
  Try: Smaller external link icon (#50728)
  Block Editor: Remove unused 'useIsDimensionsSupportValid' method (#50735)
  Fix flaky media inserter drag-and-dropping e2e test (#50740)
  docs: Fix change log typo (#50737)
  Edit Site: Fix `useEditedEntityRecord()` loading state (#50730)
  Fix labelling, description, and focus style of the block transform to pattern previews (#50577)
  Fix Global Styles sidebar block selection on zoom out mode (#50708)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Ideas about improving block and theme developer experience [Type] Developer Documentation Documentation for developers
Projects
None yet
4 participants