Skip to content

Commit

Permalink
Improve autogenerated API docs (#14549)
Browse files Browse the repository at this point in the history
  • Loading branch information
nosolosw authored Mar 27, 2019
1 parent 828fe40 commit ac06e57
Show file tree
Hide file tree
Showing 30 changed files with 1,467 additions and 2,168 deletions.
16 changes: 6 additions & 10 deletions packages/a11y/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,16 @@ _This package assumes that your code will run in an **ES2015+** environment. If

<!-- START TOKEN(Autogenerated API docs) -->

### setup

[src/index.js#L16-L26](src/index.js#L16-L26)
<a name="setup" href="#setup">#</a> **setup** [\<>](src/index.js#L16-L26)

Create the live regions.

### speak

[src/index.js#L52-L66](src/index.js#L52-L66)
<a name="speak" href="#speak">#</a> **speak** [\<>](src/index.js#L52-L66)

Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.
This module is inspired by the `speak` function in wp-a11y.js

**Usage**
_Usage_

```js
import { speak } from '@wordpress/a11y';
Expand All @@ -41,10 +37,10 @@ speak( 'The message you want to send to the ARIA live region' );
speak( 'The message you want to send to the ARIA live region', 'assertive' );
```

**Parameters**
_Parameters_

- **message** `string`: The message to be announced by Assistive Technologies.
- **ariaLive** `string`: Optional. The politeness level for aria-live. Possible values: polite or assertive. Default polite.
- _message_ `string`: The message to be announced by Assistive Technologies.
- _ariaLive_ `string`: Optional. The politeness level for aria-live. Possible values: polite or assertive. Default polite.


<!-- END TOKEN(Autogenerated API docs) -->
Expand Down
30 changes: 13 additions & 17 deletions packages/autop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,55 +16,51 @@ _This package assumes that your code will run in an **ES2015+** environment. If

<!-- START TOKEN(Autogenerated API docs) -->

#### autop

[src/index.js#L129-L285](src/index.js#L129-L285)
<a name="autop" href="#autop">#</a> **autop** [\<>](src/index.js#L129-L285)

Replaces double line-breaks with paragraph elements.

A group of regex replaces used to identify text formatted with newlines and
replace double line-breaks with HTML paragraph tags. The remaining line-
breaks after conversion become `<br />` tags, unless br is set to 'false'.

**Usage**
_Usage_

```js
import { autop } from '@wordpress/autop';
autop( 'my text' ); // "<p>my text</p>"
```

**Parameters**

- **text** `string`: The text which has to be formatted.
- **br** `boolean`: Optional. If set, will convert all remaining line- breaks after paragraphing. Default true.
_Parameters_

**Returns**
- _text_ `string`: The text which has to be formatted.
- _br_ `boolean`: Optional. If set, will convert all remaining line- breaks after paragraphing. Default true.

`string`: Text which has been converted into paragraph tags.
_Returns_

#### removep
- `string`: Text which has been converted into paragraph tags.

[src/index.js#L303-L426](src/index.js#L303-L426)
<a name="removep" href="#removep">#</a> **removep** [\<>](src/index.js#L303-L426)

Replaces `<p>` tags with two line breaks. "Opposite" of autop().

Replaces `<p>` tags with two line breaks except where the `<p>` has attributes.
Unifies whitespace. Indents `<li>`, `<dt>` and `<dd>` for better readability.

**Usage**
_Usage_

```js
import { removep } from '@wordpress/autop';
removep( '<p>my text</p>' ); // "my text"
```

**Parameters**
_Parameters_

- **html** `string`: The content from the editor.
- _html_ `string`: The content from the editor.

**Returns**
_Returns_

`string`: The content with stripped paragraph tags.
- `string`: The content with stripped paragraph tags.


<!-- END TOKEN(Autogenerated API docs) -->
Expand Down
44 changes: 18 additions & 26 deletions packages/blob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,59 +14,51 @@ npm install @wordpress/blob --save

<!-- START TOKEN(Autogenerated API docs) -->

### createBlobURL

[src/index.js#L15-L21](src/index.js#L15-L21)
<a name="createBlobURL" href="#createBlobURL">#</a> **createBlobURL** [\<>](src/index.js#L15-L21)

Create a blob URL from a file.

**Parameters**

- **file** `File`: The file to create a blob URL for.
_Parameters_

**Returns**
- _file_ `File`: The file to create a blob URL for.

`string`: The blob URL.
_Returns_

### getBlobByURL
- `string`: The blob URL.

[src/index.js#L32-L34](src/index.js#L32-L34)
<a name="getBlobByURL" href="#getBlobByURL">#</a> **getBlobByURL** [\<>](src/index.js#L32-L34)

Retrieve a file based on a blob URL. The file must have been created by
`createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
`undefined`.

**Parameters**
_Parameters_

- **url** `string`: The blob URL.
- _url_ `string`: The blob URL.

**Returns**
_Returns_

`?File`: The file for the blob URL.
- `?File`: The file for the blob URL.

### isBlobURL

[src/index.js#L56-L61](src/index.js#L56-L61)
<a name="isBlobURL" href="#isBlobURL">#</a> **isBlobURL** [\<>](src/index.js#L56-L61)

Check whether a url is a blob url.

**Parameters**

- **url** `string`: The URL.
_Parameters_

**Returns**
- _url_ `string`: The URL.

`boolean`: Is the url a blob url?
_Returns_

### revokeBlobURL
- `boolean`: Is the url a blob url?

[src/index.js#L41-L47](src/index.js#L41-L47)
<a name="revokeBlobURL" href="#revokeBlobURL">#</a> **revokeBlobURL** [\<>](src/index.js#L41-L47)

Remove the resource and file cache from memory.

**Parameters**
_Parameters_

- **url** `string`: The blob URL.
- _url_ `string`: The blob URL.


<!-- END TOKEN(Autogenerated API docs) -->
Expand Down
Loading

0 comments on commit ac06e57

Please sign in to comment.