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

Reformat and correct blocks/README.md #1794

Merged
merged 5 commits into from
Jul 7, 2017
Merged

Reformat and correct blocks/README.md #1794

merged 5 commits into from
Jul 7, 2017

Conversation

nylen
Copy link
Member

@nylen nylen commented Jul 7, 2017

Mostly fixing the hook names updated/added in #1717; also reformatting a few things for clarity and for readability of the source file.

Temporary fix pending a more complete documentation solution like #1786 - we should get this in first.
People will be reading this document more and more as it's linked from make/core posts, and perhaps more importantly, it's now actually possible to create plugins that register blocks.

It will be easiest to review this PR using GitHub's markdown diff mode.

@nylen nylen added [Feature] Block API API that allows to express the block paradigm. [Type] Developer Documentation Documentation for developers labels Jul 7, 2017
@nylen nylen requested review from youknowriad and aduth July 7, 2017 20:15
blocks/README.md Outdated
- `save( { attributes: Object } ): WPElement | String` - Returns an element
describing the markup of a block to be saved in the published content. This
function is called before save and when switching to an editor's HTML view.
- `encodeAttributes( attributes: Object ): Object` - Called when save markup is
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably drop this as it's not implemented

blocks/README.md Outdated
- `placeholder: string` - A text hint to be shown to the user when the field value is empty, similar to the [`input` and `textarea` attribute of the same name](https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/HTML5_updates#The_placeholder_attribute)
- `value: string` - Markup value of the editable field. Only valid markup is allowed, as determined by `inline` value and available controls.
- `onChange: Function` - Callback handler when the value of the field changes, passing the new value as its only argument.
- `inline: boolean` - If true, only inline elements are allowed to be used in
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's multiple prop (which takes a tagName) now as it's inline by default.

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this 👍

It buys us time to build the documentation website with the guide.

@nylen
Copy link
Member Author

nylen commented Jul 7, 2017

I would rather recommend ES6 modules than IIFEs

This is where it'll be really important to provide a working template/example that people can use to get started. In the meantime I've updated the wording here.

@nylen nylen merged commit ac75dba into master Jul 7, 2017
@nylen nylen deleted the update/blocks-readme branch July 7, 2017 21:40
Tug pushed a commit that referenced this pull request Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants