Skip to content

Commit 60727df

Browse files
committed
Add improved docs
1 parent be69c9d commit 60727df

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {modifyChildren} from 'unist-util-modify-children'
99
* Merge emoticons in `node` into `EmoticonNode`s.
1010
*
1111
* @param node
12-
* Paragraph.
12+
* nlcst paragraph to transform.
1313
* @returns
1414
* Nothing.
1515
*/

readme.md

+34-10
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
* [Install](#install)
1818
* [Use](#use)
1919
* [API](#api)
20-
* [`affixEmoticonModifier(paragraph)`](#affixemoticonmodifierparagraph)
20+
* [`affixEmoticonModifier(node)`](#affixemoticonmodifiernode)
21+
* [`Emoticon`](#emoticon)
2122
* [Types](#types)
2223
* [Compatibility](#compatibility)
2324
* [Related](#related)
@@ -45,7 +46,7 @@ higher-level (easier) abstraction.
4546
## Install
4647

4748
This package is [ESM only][esm].
48-
In Node.js (version 12.20+, 14.14+, 16.0+, 18.0+), install with [npm][]:
49+
In Node.js (version 14.14+ and 16.0+), install with [npm][]:
4950

5051
```sh
5152
npm install nlcst-affix-emoticon-modifier
@@ -54,14 +55,14 @@ npm install nlcst-affix-emoticon-modifier
5455
In Deno with [`esm.sh`][esmsh]:
5556

5657
```js
57-
import {affixEmoticonModifier} from "https://esm.sh/nlcst-affix-emoticon-modifier@2"
58+
import {affixEmoticonModifier} from 'https://esm.sh/nlcst-affix-emoticon-modifier@2'
5859
```
5960

6061
In browsers with [`esm.sh`][esmsh]:
6162

6263
```html
6364
<script type="module">
64-
import {affixEmoticonModifier} from "https://esm.sh/nlcst-affix-emoticon-modifier@2?bundle"
65+
import {affixEmoticonModifier} from 'https://esm.sh/nlcst-affix-emoticon-modifier@2?bundle'
6566
</script>
6667
```
6768

@@ -110,19 +111,36 @@ RootNode[1] (1:1-1:25, 0-24)
110111

111112
## API
112113

113-
This package exports the identifier `affixEmoticonModifier`.
114+
This package exports the identifier
115+
[`affixEmoticonModifier`][affixemoticonmodifier].
114116
There is no default export.
115117

116-
### `affixEmoticonModifier(paragraph)`
118+
### `affixEmoticonModifier(node)`
117119

118-
Merge affix emoticons (`EmoticonNode`) in `node` ([`Paragraph`][paragraph]).
120+
Merge emoticons in `node` into `EmoticonNode`s.
121+
122+
###### Parameters
123+
124+
* `node` ([`Paragraph`][paragraph])
125+
— nlcst paragraph to transform
126+
127+
###### Returns
128+
129+
Nothing (`void`).
130+
131+
### `Emoticon`
132+
133+
Emoticon node (TypeScript type).
134+
135+
See [`Emoticon` in `nlcst-emoticon-modifier`][emoticon-mofifier-emoticon].
119136

120137
## Types
121138

122139
This package is fully typed with [TypeScript][].
123-
It exports no additional types.
140+
It exports the additional type [`Emoticon`][emoticon].
124141

125-
It also registers the `Emoticon` node type with `@types/nlcst`.
142+
It also registers the `Emoticon` node type with `@types/nlcst` in
143+
`SentenceContentMap`.
126144
If you’re working with the syntax tree, make sure to import this utility
127145
somewhere in your types, as that registers the new node types in the tree.
128146

@@ -145,7 +163,7 @@ visit(tree, (node) => {
145163

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

151169
## Related
@@ -226,3 +244,9 @@ abide by its terms.
226244
[nlcst-emoticon-modifier]: https://github.com/syntax-tree/nlcst-emoticon-modifier
227245

228246
[nlcst-emoji-modifier]: https://github.com/syntax-tree/nlcst-emoji-modifier
247+
248+
[emoticon-mofifier-emoticon]: https://github.com/syntax-tree/nlcst-emoticon-modifier#emoticon
249+
250+
[affixemoticonmodifier]: #affixemoticonmodifiernode
251+
252+
[emoticon]: #emoticon

0 commit comments

Comments
 (0)