markdownlint-rule-github-internal-links

0.1.0 • Public • Published

markdownlint-rule-github-internal-links

Custom markdownlint rule for checking internal links like those generated by Github's Markdown processor. Specifically, this rule checks that internal links (of the form #anchor) match the anchors generated by this anchor generation code, or manually inserted anchors via name or id attributes.

For example, in this README.md, the link #configuration will not report an error, while the link #config will. In addition, the links #enable-rule and #add-package will match the manually inserted anchors below, while the link #add-rule will report an error.

Usage

  1. Add this package to your project:

    npm install -D markdownlint-rule-github-internal-links
  2. Enable the rule:

Configuration

You can pass in a setting of verbose: true to make this plugin display every anchor link it computes and every link it tests. This can be useful for debugging your anchor links, when it's hard to guess how many -s to add. See sample .markdownlint.yaml (for cli or cli2) and sample .markdownlint-cli2.jsonc (for cli2).

More Complex Example

A more complex example is the header above, which produces the link #-more-complex-example.

Readme

Keywords

Package Sidebar

Install

npm i markdownlint-rule-github-internal-links

Weekly Downloads

27

Version

0.1.0

License

MIT

Unpacked Size

12.7 kB

Total Files

7

Last publish

Collaborators

  • edemaine