Skip to content

Commit

Permalink
Docs: add tutorial for creating a custom block editor instance (#20410)
Browse files Browse the repository at this point in the history
* Add basic intro with screenshot

* Add screenshots and move to dedicated directory

* Add full tutorial from https://github.com/getdave/standalone-block-editor

This is copy/pasted from my original at https://github.com/getdave/standalone-block-editor

* Adds link to tutorial from main docs page

* Fix screenshot link reference

* Ensure tutorial is linked from the readme

* Resize all screenshots to 800w and optimise

* Crop out 1px line at top of image. Remove Plugins warning. Reoptimize.

* Tweak optimise main editor screenshot

* Add table of contents

* Adds intro to document

* Add title to tutorial to provide better context when viewing in isolation

* Update screenshot references to point at https://wordpress.org/gutenberg/

* Remove screenshots from repo

* Moves tutorial into new “platform” section

* Adds link to tutorial from platform section readme
  • Loading branch information
getdave authored Mar 6, 2020
1 parent 5be6ddf commit 9eb5eb8
Show file tree
Hide file tree
Showing 4 changed files with 642 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/designers-developers/developers/platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,10 @@ You can then add a scripts section to your package.json file, for example:
You can then use `npm run build` to build your project with all the default webpack settings already configured, likewise for formating and linting. The `start` command is used for development mode. See [the scripts package](https://www.npmjs.com/package/@wordpress/scripts) for full documentation.

You can also play with the [Gutenberg Example #03](https://github.com/WordPress/gutenberg-examples/tree/master/03-editable-esnext) for a complete setup using the wp-scripts package.

## Block Editor

The [`@wordpress/block-editor` package](https://developer.wordpress.org/block-editor/packages/packages-block-editor/) allows you to create and use standalone block editors.

You can learn more by reading the [tutorial "Building a custom block editor"](./custom-block-editor/README.md).

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Building a custom block editor

The purpose of [this tutorial](tutorial.md) is to step through the fundamentals of creating a custom instance of a "block editor".

![alt text](https://wordpress.org/gutenberg/files/2020/03/editor.png "The Standalone Editor instance populated with example Blocks within a custom WP Admin page.")

The editor you will see in this tutorial (as above) is **__not__ be the same Block Editor you are familiar with when creating Posts** in with WordPress. Rather it is an entirely **custom block editor instance** built using the lower-level [`@wordpress/block-editor`](https://developer.wordpress.org/block-editor/packages/packages-block-editor/) package (and friends).

## Following this tutorial
To follow along with this tutorial, you can [download the accompanying WordPress plugin](https://github.com/getdave/standalone-block-editor) which includes all of the examples for you to try on your own site.


## Code Syntax
Code snippets are provided in "ESNext". ESNext refers to the next versions of the language standard, plus JSX syntax.

Note that it is not required to use ESNext to create blocks or extend the editor, you can use classic JavaScript. However, once familiar with ESNext, developers find it is easier to read and write, thus most code examples you'll find use the ESNext syntax.
Loading

0 comments on commit 9eb5eb8

Please sign in to comment.