@textlint-rule/textlint-rule-require-header-id

1.0.1 • Public • Published

@textlint-rule/textlint-rule-require-header-id Build Status

textlint rule that require {#id} for each headers.

Example

OK:

# Header {#id1}
## Header {#id2}
### Header {#id3}
#### Header {#id4}
##### Header {#id5}

NG:

# Header
## Header

Install

Install with npm:

npm install @textlint-rule/textlint-rule-require-header-id

Usage

Via .textlintrc(Recommended)

{
    "rules": {
        "@textlint-rule/require-header-id": true
    }
}

Via CLI

textlint --rule @textlint-rule/require-header-id README.md

Options

const DefaultOptions = {
    /**
     * Id style
     *
     * GitBook: {#id}
     */
    style: "GitBook",
    /**
     * allow to header depth
     * If you want to allow h1, set this option to follows
     * [1]
     */
    allowDepth: []
};

If you want to add another id style, please submit to Pull Request!

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu

Readme

Keywords

Package Sidebar

Install

npm i @textlint-rule/textlint-rule-require-header-id

Weekly Downloads

376

Version

1.0.1

License

MIT

Unpacked Size

9.51 kB

Total Files

6

Last publish

Collaborators

  • textlint-user
  • hata6502
  • azu
  • nodaguti
  • 0x6b