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

Update: Docs: chore: Update doc blocks after changes to the blocks API #9914

Merged
merged 1 commit into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions docs/data/data-core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,38 @@ Returns an array with the child blocks of a given block.

Array of child block names.

### getBlockSupport

Returns the block support value for a feature, if defined.

*Parameters*

* state: Data state.
* nameOrType: Block name or type object
* feature: Feature to retrieve
* defaultSupports: Default value to return if not
explicitly defined
Copy link
Member

Choose a reason for hiding this comment

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

Separate task, but docs tool should be improved to ignore extra whitespace like this. Doesn't have a noticeable impact on the generated markdown result (at least in GitHub, maybe it does for WordPress handbook).


*Returns*

Block support value

### hasBlockSupport

Returns true if the block defines support for a feature, or false otherwise.

*Parameters*

* state: Data state.
* nameOrType: Block name or type object.
* feature: Feature to test.
* defaultSupports: Whether feature is supported by
default if not explicitly defined.

*Returns*

Whether block supports feature.

### hasChildBlocks

Returns a boolean indicating if a block has child blocks or not.
Expand All @@ -85,6 +117,20 @@ Returns a boolean indicating if a block has child blocks or not.

True if a block contains child blocks and false otherwise.

### hasChildBlocksWithInserterSupport

Returns a boolean indicating if a block has at least one child block with inserter support.

*Parameters*

* state: Data state.
* blockName: Block type name.

*Returns*

True if a block contains at least one child blocks with inserter support
and false otherwise.

## Actions

### addBlockTypes
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-core-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@ Returns an action object used to convert a static block into a reusable block.

*Parameters*

* clientId: The client ID of the block to detach.
* clientIds: The client IDs of the block to detach.

### insertDefaultBlock

Expand Down
6 changes: 0 additions & 6 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/language.md",
"parent": null
},
{
"title": "The Gutenberg block grammar",
"slug": "grammar",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/grammar.md",
"parent": "language"
},
{
"title": "Block API",
"slug": "block-api",
Expand Down