-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Fix sample code of Block Preview in block registration docs #23899
Docs: Fix sample code of Block Preview in block registration docs #23899
Conversation
docs/designers-developers/developers/block-api/block-registration.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inner blocks array should contain block object
…ion.md inner blocks array should contain block object Co-authored-by: Ajit Bohra <[email protected]>
@ajitbohra Thank you :) I commited your change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to request more changes.
Just a couple of things to make this match the coding standards.
{ | ||
name: 'core/paragraph', | ||
attributes: { | ||
/* translators: example text. */ | ||
content: __( | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.' | ||
), | ||
}, | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This object (lines 199-207) should be indented by four spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @talldan.
I just have a question. According to the .editorconfig
of Gutenberg, it says indent should be tab.
https://github.com/naogify/gutenberg/blob/docs/update-block-registration/.editorconfig#L14
The codingstandards of of documentaiotn is different from the one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@naogify That's true, the coding standards say tabs - https://make.wordpress.org/core/handbook/best-practices/coding-standards/javascript/#spacing.
In my comment above I mostly opted for consistency with the surrounding code which seemed to be indented using four spaces, but checking the rest of the file it seems inconsistent, sometimes tabs, sometimes spaces.
I think it probably doesn't matter so much in documentation, as long as it looks correct. The trouble is that it's harder to enforce without code linting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@talldan We have documentation linting and prettier for docs, not enforced yet as the config and definitions needs some refining, but the basics are in place.
Editor config for setting up Prettier:
https://developer.wordpress.org/block-editor/contributors/document/#editor-config
And the linting uses markdownlint that also can be setup in editor or run using: npm run lint:md-docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkaz Thanks for the info! I managed to get that working in my editor. Looking forward to being able to write everything on one line, and then magically have it formatted when saving 😄 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: 'core/paragraph', | ||
attributes: { | ||
/* translators: example text. */ | ||
content: __( | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.' | ||
), | ||
}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just missing a trailing comma here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I fixed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍
@ajitbohra ping, I think this one is all set to merge, can you clear your "request change"? Thanks! |
Description
Fix example code of adding innerBlocks to Block Preview in block registration document.
I described the detail in #23898
How has this been tested?
I checked the preview of the document on my GitHub.
https://github.com/naogify/gutenberg/blob/docs/update-block-registration/docs/designers-developers/developers/block-api/block-registration.md
Screenshots
Types of changes
Documentation
Checklist: