remark-lint-no-duplicate-headings-in-section
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -7,5 +7,4 @@ /** | ||
* @fileoverview | ||
* Warn when duplicate headings are found, | ||
* but only when on the same level, “in” | ||
* the same section. | ||
* Warn when duplicate headings are found, but only when on the same level, | ||
* “in” the same section. | ||
* | ||
@@ -12,0 +11,0 @@ * @example {"name": "valid.md"} |
{ | ||
"name": "remark-lint-no-duplicate-headings-in-section", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "remark-lint rule to warn on duplicate headings in a section", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -5,17 +5,15 @@ <!--This file is generated--> | ||
Warn when duplicate headings are found, | ||
but only when on the same level, “in” | ||
the same section. | ||
Warn when duplicate headings are found, but only when on the same level, | ||
“in” the same section. | ||
## Install | ||
## Presets | ||
```sh | ||
npm install --save remark-lint-no-duplicate-headings-in-section | ||
``` | ||
This rule is not included in any default preset | ||
## Example | ||
When this rule is turned on, the following file | ||
`valid.md` is ok: | ||
##### `valid.md` | ||
###### In | ||
```markdown | ||
@@ -39,5 +37,10 @@ ## Alpha | ||
When this rule is turned on, the following file | ||
`invalid.md` is **not** ok: | ||
###### Out | ||
No messages. | ||
##### `invalid.md` | ||
###### In | ||
```markdown | ||
@@ -51,2 +54,4 @@ ## Foxtrot | ||
###### Out | ||
```text | ||
@@ -56,4 +61,47 @@ 5:1-5:9: Do not use headings with similar content per section (3:1) | ||
## Install | ||
```sh | ||
npm install remark-lint-no-duplicate-headings-in-section | ||
``` | ||
## Usage | ||
You probably want to use it on the CLI through a config file: | ||
```diff | ||
... | ||
"remarkConfig": { | ||
"plugins": [ | ||
... | ||
"lint", | ||
+ "lint-no-duplicate-headings-in-section", | ||
... | ||
] | ||
} | ||
... | ||
``` | ||
Or use it on the CLI directly | ||
```sh | ||
remark -u lint -u lint-no-duplicate-headings-in-section readme.md | ||
``` | ||
Or use this on the API: | ||
```diff | ||
var remark = require('remark'); | ||
var report = require('vfile-reporter'); | ||
remark() | ||
.use(require('remark-lint')) | ||
+ .use(require('remark-lint-no-duplicate-headings-in-section')) | ||
.process('_Emphasis_ and **importance**', function (err, file) { | ||
console.error(report(err || file)); | ||
}); | ||
``` | ||
## License | ||
[MIT](https://github.com/wooorm/remark-lint/blob/master/LICENSE) © [Titus Wormer](http://wooorm.com) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4012
104
68