Skip to content

Add "components" doc. - #2762

Closed
mtias wants to merge 1 commit into
masterfrom
add/block-components-doc
Closed

mtias wants to merge 1 commit into
masterfrom
add/block-components-doc

Conversation

@mtias

@mtias mtias commented Sep 21, 2017

Copy link
Copy Markdown
Member

Work in progress: document the tools and components we have for creating blocks.

@mtias mtias added [Type] Developer Documentation Documentation for developers [Status] In Progress Tracking issues with work in progress labels Sep 21, 2017
Comment thread docs/block-components.md
At the core of rich text formatting in Gutenberg lies the `Editable` component. It's a wrapper and controller around the TinyMCE library, and can be used by any block to power any rich text editing features. It us used for captions under images or embeds, for the separate fields in a quote, etc.

<ul>
<li><strong>Type:</strong> <code>Function</code></li>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Technically a function, but more specifically a Component class.

Comment thread docs/block-components.md
}

return el(
<Editable,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove leading <

Comment thread docs/block-components.md
placeholder={ __( 'Write caption…' ) }
value={ caption }
focus={ focus && focus.editable === 'caption' ? focus : undefined }
onFocus={ focusCaption }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

straightforward 😬

Comment thread docs/block-components.md

## Editable

At the core of rich text formatting in Gutenberg lies the `Editable` component. It's a wrapper and controller around the TinyMCE library, and can be used by any block to power any rich text editing features. It us used for captions under images or embeds, for the separate fields in a quote, etc.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Typo, It is used for captions rather than It us used for captions

Comment thread docs/block-components.md

In order to make it easier to create sophisticated blocks quickly, reducing the amount of work you have to do to develop common functionality, several components have been created which can be accessed through the `wp.components` global. This section covers the available UI components.

## Placeholder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just an idea, should we maybe keep the component related docs in their own README files and only cross-link them in here with a very brief description?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'd prefer to have them here as this will easier to navigate and refer to.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A middle-ground could be to create a separate page for each component using its README

@gziolo
gziolo self-requested a review October 10, 2017 16:33
@gziolo

gziolo commented Jan 27, 2018

Copy link
Copy Markdown
Member

@mtias is it still relevant?

@mtias

mtias commented Feb 8, 2018

Copy link
Copy Markdown
Member Author

@gziolo it'd be nice to generate these from each component's readme. Otherwise it'd be hard to maintain.

@gziolo

gziolo commented Feb 8, 2018

Copy link
Copy Markdown
Member

Right, it makes a lot of sense what you proposed. I'm closing this one, will open an issue if we don't have one.

@gziolo gziolo closed this Feb 8, 2018
@gziolo
gziolo deleted the add/block-components-doc branch February 8, 2018 12:45
@mtias

mtias commented Feb 8, 2018

Copy link
Copy Markdown
Member Author

We can reuse some of the copy here and just start PRs for each component.

@gziolo

gziolo commented Feb 8, 2018

Copy link
Copy Markdown
Member

@mtias #4952 - feel free to edit description there 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] In Progress Tracking issues with work in progress [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants