Skip to content
This repository was archived by the owner on Feb 10, 2020. It is now read-only.

Commit 23e7afc

Browse files
committed
Update readme for npm package and example usage
1 parent 66a9056 commit 23e7afc

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This project is in its early stages. Please [open an issue](https://github.com/r
1212

1313
Gutenberg fields middleware requires only two files `dist/middleware.min.js` and `dist/middleware.min.css` as dependency.
1414

15-
There are two ways of using the middleware.
15+
There are two ways of using fields middleware.
1616

1717
1. **As a Plugin:** Install the Gutenberg Fields Middleware as a standalone WordPress plugin which will register a `gutenberg-fields-middleware` handle you can add as a dependency for your block script.
1818
2. **Using JS and CSS files:** Or you can use `middleware.min.js` and `middleware.min.css` and enqueue them as dependency for your block script. Be sure to use `array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-date', 'wp-hooks' )` handles as your dependency when enqueing middleware js file.
@@ -100,6 +100,14 @@ register_block_type( 'example-namespace/example-block', array(
100100

101101

102102

103+
✔️ Gutenberg fields middleware is also available as npm [package](https://www.npmjs.com/package/gutenberg-fields-middleware).
104+
105+
```bash
106+
npm i gutenberg-fields-middleware
107+
```
108+
109+
110+
103111
## Available Fields
104112

105113
Gutenberg Fields Middleware supports the following field types and type configuration.
@@ -149,3 +157,10 @@ Gutenberg Fields Middleware supports the following field types and type configur
149157

150158
See [example usage](docs/alignment-toolbar.md#example-usage--es5-) of alignment-toolbar.
151159

160+
161+
162+
#### Example Usage:
163+
164+
- See [examples](examples/)
165+
- Check [gutenberg-supplements](https://github.com/rtCamp/gutenberg-supplements) plugin where we have created some actual blocks using middleware.
166+

0 commit comments

Comments
 (0)