Repository navigation
docgen: Automatic documentation handle for TypeScript overloads #77558
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
Changes from 5 commits
b68c05d
1dc05c3
d88fdad
b6c4267
374503c
a4ce6bd
5ebedb0
21a4472
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -607,7 +607,31 @@ _Parameters_ | |||||
|
|
||||||
| ### registerBlockType | ||||||
|
|
||||||
| Undocumented declaration. | ||||||
| Registers a new block provided a unique name and an object defining its behavior. Once registered, the block is made available as an option to any editor interface where blocks are implemented. | ||||||
|
|
||||||
| For more in-depth information on registering a custom block see the [Create a block tutorial](https://developer.wordpress.org/block-editor/getting-started/create-block/). | ||||||
|
|
||||||
| _Usage_ | ||||||
|
|
||||||
| ```js | ||||||
| import { __ } from '@wordpress/i18n'; | ||||||
| import { registerBlockType } from '@wordpress/blocks'; | ||||||
|
|
||||||
| registerBlockType( 'namespace/block-name', { | ||||||
| title: __( 'My First Block' ), | ||||||
| edit: () => <div>{ __( 'Hello from the editor!' ) }</div>, | ||||||
| save: () => <div>Hello from the saved content!</div>, | ||||||
| } ); | ||||||
| ``` | ||||||
|
|
||||||
| _Parameters_ | ||||||
|
|
||||||
| - _blockNameOrMetadata_ `BlockConfiguration< Attributes >`: Block type name or its metadata. | ||||||
|
||||||
| - _blockNameOrMetadata_ `BlockConfiguration< Attributes >`: Block type name or its metadata. | |
| - _blockNameOrMetadata_ `string | BlockConfiguration< Attributes >`: Block type name or its metadata. |
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.
Grammar: “Registers a new block provided a unique name…” reads like a typo; consider “providing” (or “given”) for correct phrasing. This text comes from the source JSDoc, so fixing it there will keep regenerated docs clean.
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 seems to be an error in the doc itself and not in the scope of this PR?
cc: @manzoorwanijk @aduth
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.
Yes, we can ignore that.