remark-lint-maximum-heading-length
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "remark-lint-maximum-heading-length", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "remark-lint rule to warn when headings are too long", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -11,13 +11,18 @@ <!--This file is generated--> | ||
## Install | ||
## Presets | ||
```sh | ||
npm install --save remark-lint-maximum-heading-length | ||
``` | ||
This rule is included in the following presets: | ||
| Preset | Setting | | ||
| ------ | ------- | | ||
| [`remark-preset-lint-markdown-style-guide`](https://github.com/wooorm/remark-lint/tree/master/packages/remark-preset-lint-markdown-style-guide) | | | ||
## Example | ||
When this rule is `40`, the following file | ||
`invalid.md` is **not** ok: | ||
##### `invalid.md` | ||
When configured with `40`. | ||
###### In | ||
```markdown | ||
@@ -27,2 +32,4 @@ # Alpha bravo charlie delta echo foxtrot golf hotel | ||
###### Out | ||
```text | ||
@@ -32,5 +39,6 @@ 1:1-1:52: Use headings shorter than `40` | ||
When this rule is turned on, the following file | ||
`valid.md` is ok: | ||
##### `valid.md` | ||
###### In | ||
```markdown | ||
@@ -42,4 +50,51 @@ # Alpha bravo charlie delta echo foxtrot golf hotel | ||
###### Out | ||
No messages. | ||
## Install | ||
```sh | ||
npm install remark-lint-maximum-heading-length | ||
``` | ||
## Usage | ||
You probably want to use it on the CLI through a config file: | ||
```diff | ||
... | ||
"remarkConfig": { | ||
"plugins": [ | ||
... | ||
"lint", | ||
+ "lint-maximum-heading-length", | ||
... | ||
] | ||
} | ||
... | ||
``` | ||
Or use it on the CLI directly | ||
```sh | ||
remark -u lint -u lint-maximum-heading-length 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-maximum-heading-length')) | ||
.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) |
3863
97