@@ -3,46 +3,49 @@
33[![Build][build-badge]][build]
44[![Coverage][coverage-badge]][coverage]
55[![Downloads][downloads-badge]][downloads]
6−[![Chat][chat-badge]][chat]
6+[![Size][size-badge]][size]
77[![Sponsors][sponsors-badge]][collective]
88[![Backers][backers-badge]][collective]
9+[![Chat][chat-badge]][chat]
910
10−[**remark**][remark] plugin to validate that Markdown links and images
11−reference existing local files and headings.
11+[**remark**][remark] plugin to validate that Markdown links and images reference
12+existing local files and headings.
1213It does not check external URLs (see [`remark-lint-no-dead-urls`][no-dead-urls]
1314for that).
1415
1516For example, this document does not have a heading named `Hello`.
16−So if we link to that (`[welcome](#hello)`), this plugin will warn
17−about it.
17+So if we link to that (`[welcome](#hello)`), this plugin will warn about it.
1818
1919In addition, when I link to a heading in another document
20−(`examples/foo.md#hello`), if this file exists but the heading does not,
21−or if the file does not exist, this plugin will also warn.
20+(`examples/foo.md#hello`), if this file exists but the heading does not, or if
21+the file does not exist, this plugin will also warn.
2222
23−Linking to other files, such as `license` or `index.js` (when they exist)
24−is fine.
23+Linking to other files, such as `license` or `index.js` (when they exist) is
24+fine.
2525
2626## Table of Contents
2727
28−* [Installation](#installation)
29−* [Command line](#command-line)
30−* [Programmatic](#programmatic)
28+* [Install](#install)
29+* [Use](#use)
30+ * [CLI](#cli)
31+ * [API](#api)
3132* [Configuration](#configuration)
3233* [Integration](#integration)
3334* [Related](#related)
3435* [Contribute](#contribute)
3536* [License](#license)
3637
37−## Installation
38+## Install
3839
3940[npm][]:
4041
41−```bash
42+```sh
4243npm install remark-validate-links
4344```
4445
45−## Command line
46+## Use
47+
48+### CLI
4649
4750Use `remark-validate-links` together with [**remark**][remark]:
4851
@@ -76,9 +79,10 @@ readme.md: no issues found
7679⚠ 2 warnings
7780```
7881
79−## Programmatic
82+### API
8083
81−> Note: The API only checks links to headings. Other URLs are not checked.
84+> Note: The API only checks links to headings.
85+> Other URLs are not checked.
8286
8387Say we have the following file, `example.md`:
8488
@@ -97,7 +101,7 @@ This is [not checked](readme.md#bravo).
97101
98102And our script, `example.js`, looks as follows:
99103
100−```javascript
104+```js
101105var vfile = require('to-vfile')
102106var report = require('vfile-reporter')
103107var remark = require('remark')
@@ -122,16 +126,16 @@ example.md
122126## Configuration
123127
124128You can pass a `repository`, containing anything `package.json`s
125−[`repository`][package-repository] can handle. If this is omitted,
126−`remark-validate-links` will try the `package.json` in your current working
127−directory.
129+[`repository`][package-repository] can handle.
130+If this is not given, `remark-validate-links` will try the `package.json` in
131+the current working directory.
128132
129−```bash
133+```sh
130134remark --use 'validate-links=repository:"foo/bar"' example.md
131135```
132136
133137When a repository is given or detected (supporting GitHub, GitLab, and
134−Bitbucket), links to the files are normalized to the file-system.
138+Bitbucket), links to the files are normalized to the file system.
135139For example, `https://github.com/foo/bar/blob/master/example.md` becomes
136140`example.md`.
137141
@@ -170,11 +174,13 @@ on nodes:
170174
171175## Contribute
172176
173−See [`contributing.md` in `remarkjs/remark`][contributing] for ways to get
174−started.
177+See [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways
178+to get started.
179+See [`support.md`][support] for ways to get help.
175180
176−This organisation has a [Code of Conduct][coc]. By interacting with this
177−repository, organisation, or community you agree to abide by its terms.
181+This project has a [Code of Conduct][coc].
182+By interacting with this repository, organisation, or community you agree to
183+abide by its terms.
178184
179185## License
180186
@@ -182,7 +188,7 @@ repository, organisation, or community you agree to abide by its terms.
182188
183189<!-- Definitions -->
184190
185−[build-badge]: https://img.shields.io/travis/remarkjs/remark-validate-links.svg
191+[build-badge]: https://img.shields.io/travis/remarkjs/remark-validate-links/master.svg
186192
187193[build]: https://travis-ci.org/remarkjs/remark-validate-links
188194
@@ -194,9 +200,9 @@ repository, organisation, or community you agree to abide by its terms.
194200
195201[downloads]: https://www.npmjs.com/package/remark-validate-links
196202
197−[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
203+[size-badge]: https://img.shields.io/bundlephobia/minzip/remark-validate-links.svg
198204
199−[chat]: https://spectrum.chat/unified/remark
205+[size]: https://bundlephobia.com/result?p=remark-validate-links
200206
201207[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
202208
@@ -204,24 +210,32 @@ repository, organisation, or community you agree to abide by its terms.
204210
205211[collective]: https://opencollective.com/unified
206212
207−[license]: license
213+[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
208214
209−[author]: https://wooorm.com
215+[chat]: https://spectrum.chat/unified/remark
210216
211217[npm]: https://docs.npmjs.com/cli/install
212218
213−[remark]: https://github.com/remarkjs/remark
219+[health]: https://github.com/remarkjs/.github
214220
215−[remark-lint]: https://github.com/remarkjs/remark-lint
221+[contributing]: https://github.com/remarkjs/.github/blob/master/contributing.md
216222
217−[no-dead-urls]: https://github.com/davidtheclark/remark-lint-no-dead-urls
223+[support]: https://github.com/remarkjs/.github/blob/master/support.md
218224
219−[remark-html]: https://github.com/remarkjs/remark-html
225+[coc]: https://github.com/remarkjs/.github/blob/master/code-of-conduct.md
220226
221−[package-repository]: https://docs.npmjs.com/files/package.json#repository
227+[license]: license
228+
229+[author]: https://wooorm.com
230+
231+[remark]: https://github.com/remarkjs/remark
222232
223233[cli]: https://github.com/remarkjs/remark/tree/master/packages/remark-cli#readme
224234
225−[contributing]: https://github.com/remarkjs/remark/blob/master/contributing.md
235+[remark-lint]: https://github.com/remarkjs/remark-lint
236+
237+[remark-html]: https://github.com/remarkjs/remark-html
226238
227−[coc]: https://github.com/remarkjs/remark/blob/master/code-of-conduct.md
239+[no-dead-urls]: https://github.com/davidtheclark/remark-lint-no-dead-urls
240+
241+[package-repository]: https://docs.npmjs.com/files/package.json#repository