From 23e7afc173f7e61ff53a1295349a724528e5a61d Mon Sep 17 00:00:00 2001 From: Sayed Taqui Date: Tue, 1 May 2018 23:19:06 +0530 Subject: [PATCH] Update readme for npm package and example usage --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fa6eab..31cc7e6 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This project is in its early stages. Please [open an issue](https://github.com/r Gutenberg fields middleware requires only two files `dist/middleware.min.js` and `dist/middleware.min.css` as dependency. -There are two ways of using the middleware. +There are two ways of using fields middleware. 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. 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( +✔️ Gutenberg fields middleware is also available as npm [package](https://www.npmjs.com/package/gutenberg-fields-middleware). + +```bash +npm i gutenberg-fields-middleware +``` + + + ## Available Fields 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 See [example usage](docs/alignment-toolbar.md#example-usage--es5-) of alignment-toolbar. + + +#### Example Usage: + +- See [examples](examples/) +- Check [gutenberg-supplements](https://github.com/rtCamp/gutenberg-supplements) plugin where we have created some actual blocks using middleware. +