|
72 | 72 | * Configuration. |
73 | 73 | * |
74 | 74 | * @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 | + * |
76 | 108 | * @property {string | null | undefined} [headingPrefix] |
77 | 109 | * Prefix of headings (example: `'#'`, `'#markdown-header-'`). |
78 | 110 | * @property {string | null | undefined} [hostname] |
@@ -132,8 +164,13 @@ const readmeExtensions = new Set(['.markdown', '.mdown', '.mkdn', '.md']) |
132 | 164 | const readmeBasename = /^readme$/i |
133 | 165 |
|
134 | 166 | /** |
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. |
137 | 174 | * |
138 | 175 | * @param {Readonly<Options> | null | undefined} [options] |
139 | 176 | * Configuration (optional). |
|
0 commit comments