Skip to content

Commit b3985e2

Browse files
committed
Refactor docs
1 parent 323908a commit b3985e2

File tree

2 files changed

+150
-84
lines changed

2 files changed

+150
-84
lines changed

lib/index.js

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,39 @@
7272
* Configuration.
7373
*
7474
* @typedef UrlConfig
75-
* Hosted Git info
75+
* Hosted Git info.
76+
*
77+
* ###### Notes
78+
*
79+
* For this repository (`remarkjs/remark-validate-links` on GitHub)
80+
* `urlConfig` looks as follows:
81+
*
82+
* ```js
83+
* {
84+
* // Domain of URLs:
85+
* hostname: 'github.com',
86+
* // Path prefix before files:
87+
* prefix: '/remarkjs/remark-validate-links/blob/',
88+
* // Prefix of headings:
89+
* headingPrefix: '#',
90+
* // Hash to top of markdown documents:
91+
* topAnchor: '#readme',
92+
* // Whether lines in files can be linked:
93+
* lines: true
94+
* }
95+
* ```
96+
*
97+
* If this project were hosted on Bitbucket, it would be:
98+
*
99+
* ```js
100+
* {
101+
* hostname: 'bitbucket.org',
102+
* prefix: '/remarkjs/remark-validate-links/src/',
103+
* headingPrefix: '#markdown-header-',
104+
* lines: false
105+
* }
106+
* ```
107+
*
76108
* @property {string | null | undefined} [headingPrefix]
77109
* Prefix of headings (example: `'#'`, `'#markdown-header-'`).
78110
* @property {string | null | undefined} [hostname]
@@ -132,8 +164,13 @@ const readmeExtensions = new Set(['.markdown', '.mdown', '.mkdn', '.md'])
132164
const readmeBasename = /^readme$/i
133165

134166
/**
135-
* Validate that Markdown links and images reference existing local files and
136-
* headings.
167+
* Check that markdown links and images point to existing local files and
168+
* headings in a Git repo.
169+
*
170+
* > ⚠️ **Important**: The API in Node.js checks links to headings and files
171+
* > but does not check whether headings in other files exist.
172+
* > The API in browsers only checks links to headings in the same file.
173+
* > The CLI can check everything.
137174
*
138175
* @param {Readonly<Options> | null | undefined} [options]
139176
* Configuration (optional).

0 commit comments

Comments
 (0)