@textlint-rule/textlint-rule-no-dead-link
v3.2.0
Published
A textlint rule to check if all links are alive
Downloads
7
Readme
textlint-rule-no-dead-link
This is fork of nodaguti/textlint-rule-no-dead-link.
For more details, see Temporary fork · Issue #1 · textlint-rule/textlint-rule-no-dead-link-fork.
textlint rule to make sure every link in a document is available.
The primary target of this rule is Markdown documents, while it may also work for plain text documents (See tests).
Installation
$ npm install @textlint-rule/textlint-rule-no-dead-link
Usage
$ npm install textlint textlint-rule-no-dead-link
$ textlint --rule textlint-rule-no-dead-link text-to-check.txt
Options
Please write your configurations in .textlintrc
.
The default options are:
{
"rules": {
"@textlint-rule/no-dead-link": {
"checkRelative": false,
"baseURI": null,
"ignore": [],
}
}
}
checkRelative
Enable the dead link checks against relative URIs or file path.
Relative url
You also have to specify the baseURI
to make this option work.
Relative file path
You do not need to set baseURI
option.
baseURI
The base URI to be used for resolving relative URIs.
Example:
{
"rules": {
"@textlint-rule/no-dead-link": {
"checkRelative": true,
"baseURI": "http://example.com/"
}
}
}
ignore
An array of URIs to be ignored, i.e. skipped from availability checks.
Example:
{
"rules": {
"@textlint-rule/no-dead-link": {
"ignore": [
"http://example.com/not-exist/index.html"
]
}
}
}
Tests
npm test
Contribution
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
MIT License (http://nodaguti.mit-license.org/)