Skip to content

Commit e64a57d

Browse files
committed
Refactor docs
1 parent c13a8a6 commit e64a57d

File tree

2 files changed

+39
-13
lines changed

2 files changed

+39
-13
lines changed

lib/index.js

+14
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ import {findUp} from 'vfile-find-up'
3636
let previousRange
3737

3838
/**
39+
* Ignore unrelated messages in GitHub Actions and Travis.
40+
*
41+
* There are no options.
42+
* If there’s a `TRAVIS_COMMIT_RANGE`, `GITHUB_BASE_REF` and `GITHUB_HEAD_REF`,
43+
* or `GITHUB_SHA` environment variable, then this plugin runs, otherwise it
44+
* does nothing.
45+
*
46+
* ###### To do
47+
*
48+
* * [ ] Add support for other CIs (ping if you want to work on this)
49+
* * [ ] Add non-CI support (I’m not sure how though)
50+
*
51+
* PRs welcome!
52+
*
3953
* @returns
4054
* Transform.
4155
*/

readme.md

+25-13
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ When this plugin is used outside of a supported CIs, it doesn’t do anything.
4646
## Install
4747

4848
This package is [ESM only][esm].
49-
In Node.js (version 12.20+, 14.14+, 16.0+, or 18.0+), install with [npm][]:
49+
In Node.js (version 16+), install with [npm][]:
5050

5151
```sh
5252
npm install unified-diff
@@ -79,18 +79,19 @@ This is an an example.
7979
…and our module `example.js` looks as follows:
8080

8181
```js
82-
import {read} from 'to-vfile'
83-
import {reporter} from 'vfile-reporter'
84-
import {unified} from 'unified'
85-
import unifiedDiff from 'unified-diff'
82+
import process from 'node:process'
8683
import remarkParse from 'remark-parse'
87-
import remarkStringify from 'remark-stringify'
8884
import remarkRetext from 'remark-retext'
85+
import remarkStringify from 'remark-stringify'
8986
import retextEnglish from 'retext-english'
90-
import retextRepeatedWords from 'retext-repeated-words'
9187
import retextIndefiniteArticle from 'retext-indefinite-article'
88+
import retextRepeatedWords from 'retext-repeated-words'
89+
import {read} from 'to-vfile'
90+
import {unified} from 'unified'
91+
import unifiedDiff from 'unified-diff'
92+
import {reporter} from 'vfile-reporter'
9293

93-
const file = unified()
94+
const file = await unified()
9495
.use(remarkParse)
9596
.use(
9697
remarkRetext,
@@ -166,7 +167,7 @@ an error, but it’s unrelated to the PR.
166167
## API
167168

168169
This package exports no identifiers.
169-
The default export is `unifiedDiff`.
170+
The default export is [`unifiedDiff`][api-unified-diff].
170171

171172
### `unified().use(unifiedDiff)`
172173

@@ -184,17 +185,24 @@ nothing.
184185

185186
PRs welcome!
186187

188+
###### Returns
189+
190+
Transform ([`Transformer`][transformer]).
191+
187192
## Types
188193

189194
This package is fully typed with [TypeScript][].
190-
There are no additional exported types.
195+
It exports no additional types.
191196

192197
## Compatibility
193198

194-
Projects maintained by the unified collective are compatible with all maintained
199+
Projects maintained by the unified collective are compatible with maintained
195200
versions of Node.js.
196-
As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18.0+.
197-
Our projects sometimes work with older versions, but this is not guaranteed.
201+
202+
When we cut a new major release, we drop support for unmaintained versions of
203+
Node.
204+
This means we try to keep the current release line, `unified-diff@^4`,
205+
compatible with Node.js 12.
198206

199207
## Contribute
200208

@@ -255,3 +263,7 @@ abide by its terms.
255263
[author]: https://wooorm.com
256264

257265
[unified]: https://github.com/unifiedjs/unified
266+
267+
[transformer]: https://github.com/unifiedjs/unified?tab=readme-ov-file#transformer
268+
269+
[api-unified-diff]: #unifieduseunifieddiff

0 commit comments

Comments
 (0)