From 8cfa101cb2c14058174e0f312ff59bfddc195679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Wed, 6 Mar 2019 16:26:52 +0100 Subject: [PATCH] Set up auto-docs --- bin/update-readmes.js | 2 +- packages/block-library/README.md | 15 ++++++++++++++- packages/block-library/src/index.js | 10 ++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/bin/update-readmes.js b/bin/update-readmes.js index 038cfa34c6213..8f047e2cd7e34 100755 --- a/bin/update-readmes.js +++ b/bin/update-readmes.js @@ -8,7 +8,7 @@ const packages = [ //'autop', //'blob', //'block-editor', - //'block-library', + 'block-library', //'block-serialization-default-parser', //'blocks', //'compose', diff --git a/packages/block-library/README.md b/packages/block-library/README.md index d9f50a3432a55..f21ffbea41303 100644 --- a/packages/block-library/README.md +++ b/packages/block-library/README.md @@ -12,7 +12,17 @@ npm install @wordpress/block-library --save _This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using [core-js](https://github.com/zloirock/core-js) or [@babel/polyfill](https://babeljs.io/docs/en/next/babel-polyfill) will add support for these methods. Learn more about it in [Babel docs](https://babeljs.io/docs/en/next/caveats)._ -## Usage +## API + + + +### registerCoreBlocks + +[src/index.js#L69-L130](src/index.js#L69-L130) + +Function to register core blocks provided by the block editor. + +**Usage** ```js import { registerCoreBlocks } from '@wordpress/block-library'; @@ -20,4 +30,7 @@ import { registerCoreBlocks } from '@wordpress/block-library'; registerCoreBlocks(); ``` + + +

Code is Poetry.

diff --git a/packages/block-library/src/index.js b/packages/block-library/src/index.js index eb6cd561d887a..1fc00265bc875 100644 --- a/packages/block-library/src/index.js +++ b/packages/block-library/src/index.js @@ -56,6 +56,16 @@ import * as tagCloud from './tag-cloud'; import * as classic from './classic'; +/** + * Function to register core blocks provided by the block editor. + * + * @example + * ```js + * import { registerCoreBlocks } from '@wordpress/block-library'; + * + * registerCoreBlocks(); + * ``` + */ export const registerCoreBlocks = () => { [ // Common blocks are grouped at the top to prioritize their display