Skip to content

Commit

Permalink
Add improved docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jan 25, 2023
1 parent 9b74cd9 commit 43e9be3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import {convert} from 'unist-util-is'

/**
* Check if the given value is phrasing content.
* Check if the given value is *phrasing content*.
*
* @param
* Thing to check, typically `Node`
* Thing to check, typically `Node`.
* @returns
* Whether `node` is phrasing content.
*/
Expand Down
21 changes: 14 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`phrasing(node)`](#phrasingnode)
* [`phrasing(value)`](#phrasingvalue)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
Expand All @@ -41,7 +41,7 @@ but on [hast][].
## Install

This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:
In Node.js (version 14.14+ and 16.0+), install with [npm][]:

```sh
npm install mdast-util-phrasing
Expand Down Expand Up @@ -75,16 +75,21 @@ phrasing({type: 'strong', children: [{type: 'text', value: 'Delta'}]})

## API

This package exports the identifier `phrasing`.
This package exports the identifier [`phrasing`][api-phrasing].
There is no default export.

### `phrasing(node)`
### `phrasing(value)`

Check if the given value (`unknown`) is phrasing content.
Check if the given value is *[phrasing content][phrasing]*.

###### Parameters

* `value` (`unknown`)
— thing to check, typically [`Node`][node]

###### Returns

Whether `node` is [phrasing content][phrasing] (`boolean`).
Whether `value` is phrasing content (`boolean`).

## Types

Expand All @@ -95,7 +100,7 @@ It does not export extra types.

Projects maintained by the unified collective are compatible with all maintained
versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
As of now, that is Node.js 14.14+ and 16.0+.
Our projects sometimes work with older versions, but this is not guaranteed.

## Security
Expand Down Expand Up @@ -186,3 +191,5 @@ abide by its terms.
[unist-util-is]: https://github.com/syntax-tree/unist-util-is

[hast-util-phrasing]: https://github.com/syntax-tree/hast-util-phrasing

[api-phrasing]: #phrasingvalue

0 comments on commit 43e9be3

Please sign in to comment.