-
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
Docs: Add explanations about attributes of each Core Block in the documentation (and in the source code) #64057
Comments
Hi @juanmaguitar, I’ve created an initial PR for this issue (#68508). It includes the additional code changes to the Looking forward to your feedback. |
I agree with the idea here. My initial thought on the proposal of adding JSDoc comments to the Edit components is that it introduces duplication and therefore seems less than ideal for maintenance. Has adding this directly in block json been considered? There each attribute already supports some relevant metadata ( Adding a Supporting JSON5 would probably be more work yet would seemingly have a broader appeal. Adding attribute descriptions in the way of comments should avoid the concern of bundle size increases. However, that might be less simple with regards to generating docs. |
Putting this proposal on hold until the following items are considered/resolved:
tl;dr, we need to have a good plan before moving forward and updating dozens of files. |
If we wanted to use JSON5 or JSONC to be able to insert comments, we'd probably have to convert all On the other hand, because |
IIRC, JSON5 or JSONC aren't supported by default in PHP, so I doubt the format change. P.S. There was a similar conversation for the |
The only official documentation available for core blocks is located at Block Editor Handbook > Reference Guides > Core Blocks Reference. This page lacks detailed explanations about each core block’s attributes and points the user to the source code for more information.
Providing extra explanations about the attributes of core blocks is essential for developers to fully understand and utilize these blocks effectively.
I propose including JSDoc comments in the Edit component of each block to explain the props.attributes object received by every core block’s edit component.
Besides providing extra info on these attributes directly in the source code, these descriptions could also be used (with some custom extra code) by gen-block-lib-list.js to generate more extended info for each block at Block Editor Handbook > Reference Guides > Core Blocks Reference
The text was updated successfully, but these errors were encountered: