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

Docs: include example of serialized blocks in "language" doc. #3005

Merged
merged 2 commits into from Oct 18, 2017

Conversation

mtias
Copy link
Member

@mtias mtias commented Oct 12, 2017

Adding a small section towards the end showing how blocks might be saved.

@mtias mtias added the [Type] Developer Documentation Documentation for developers label Oct 12, 2017
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

It looks good to me. I have some minor comments about spacing. It could have another review from someone more familiar with the block HTML representation.

docs/language.md Outdated
@@ -81,6 +81,24 @@ This has dramatic implications for how simple and performant we can make our par

_N.B.:_ The defining aspect of blocks are their semantics and the isolation mechanism they provide; in other words, their identity. On the other hand, where their data is stored is a more liberal aspect. Blocks support more than just static local data (via JSON literals inside the HTML comment or within the block's HTML), and more mechanisms (_e.g._, global blocks or otherwise resorting to storage in complementary `WP_Post` objects) are expected. See [attributes](../reference/attributes) for details.

## The Anatomy of a Serialized Block

When blocks are saved to the content after the editing session, the different attributes—depending on the nature of the block—are serialized to these explicit comment delimiters.
Copy link
Member

Choose a reason for hiding this comment

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

I see we use in a few places, why we avoid spaces around this delimiter?

docs/language.md Outdated
@@ -81,6 +81,24 @@ This has dramatic implications for how simple and performant we can make our par

_N.B.:_ The defining aspect of blocks are their semantics and the isolation mechanism they provide; in other words, their identity. On the other hand, where their data is stored is a more liberal aspect. Blocks support more than just static local data (via JSON literals inside the HTML comment or within the block's HTML), and more mechanisms (_e.g._, global blocks or otherwise resorting to storage in complementary `WP_Post` objects) are expected. See [attributes](../reference/attributes) for details.

## The Anatomy of a Serialized Block

When blocks are saved to the content after the editing session, the different attributes—depending on the nature of the block—are serialized to these explicit comment delimiters.
Copy link
Member

Choose a reason for hiding this comment

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

The word "different" feels out of place here. Should we drop it, or be more specific about those attributes which are serialized in the delimiters?

@mtias mtias merged commit ddda59f into master Oct 18, 2017
@mtias mtias deleted the update/language-doc-include-example branch October 18, 2017 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants