1
1
# unified-message-control [ ![ Build Status] [ build-badge ]] [ build-status ] [ ![ Coverage Status] [ coverage-badge ]] [ coverage-status ] [ ![ Chat] [ chat-badge ]] [ chat ]
2
2
3
- Enable, disable, and ignore messages with [ ** remark ** ] [ remark ] .
3
+ Enable, disable, and ignore messages with [ ** unified ** ] [ unified ] .
4
4
5
5
## Installation
6
6
7
7
[ npm] [ ] :
8
8
9
9
``` bash
10
- npm install remark -message-control
10
+ npm install unified -message-control
11
11
```
12
12
13
13
## Usage
@@ -26,11 +26,12 @@ And our script, `example.js`, looks as follows:
26
26
var vfile = require (' to-vfile' );
27
27
var report = require (' vfile-reporter' );
28
28
var remark = require (' remark' );
29
- var control = require (' remark-message-control' );
29
+ var control = require (' unified-message-control' );
30
+ var mdastMarker = require (' mdast-comment-marker' );
30
31
31
32
remark ()
32
33
.use (warn)
33
- .use (control, {name: ' foo' })
34
+ .use (control, {name: ' foo' , marker : mdastMarker, test : ' html ' })
34
35
.process (vfile .readSync (' example.md' ), function (err , file ) {
35
36
console .error (report (err || file));
36
37
});
@@ -50,7 +51,7 @@ example.md: no issues found
50
51
51
52
## API
52
53
53
- ### ` remark .use(control, options)`
54
+ ### ` unified .use(control, options)`
54
55
55
56
Let comment markers control messages from a certain sources.
56
57
@@ -66,6 +67,20 @@ For example, `{name: 'alpha'}` controls `alpha` markers:
66
67
<!--alpha ignore-->
67
68
```
68
69
70
+ ###### ` options.marker `
71
+
72
+ ` function ` — function that returns a [ comment marker object] [ marker ]
73
+ for a matched comment, and ` null ` for a non-matched comment.
74
+
75
+ ###### ` options.test `
76
+
77
+ (` Function ` , ` string ` , ` Object ` , or ` Array.<Test> ` )
78
+ — When ` string ` , works like passing `function (node) {return
79
+ node.type === test}`.
80
+ When ` array ` , checks any one of the subtests pass.
81
+ When ` object ` , checks that all keys in ` test ` are in ` node ` ,
82
+ and that they have (strictly) equal values
83
+
69
84
###### ` options.known `
70
85
71
86
` Array.<string> ` , optional — List of allowed ` ruleId ` s. When given, a warning
@@ -151,7 +166,7 @@ For example, to turn off certain messages for the next node:
151
166
152
167
## Contribute
153
168
154
- See [ ` contribute.md ` in ` remarkjs/remarkjs ` ] [ contribute ] for ways to get
169
+ See [ ` contribute.md ` in ` unified/unified ` ] [ contribute ] for ways to get
155
170
started.
156
171
157
172
This organisation has a [ Code of Conduct] [ coc ] . By interacting with this
@@ -167,9 +182,9 @@ repository, organisation, or community you agree to abide by its terms.
167
182
168
183
[ build-status ] : https://travis-ci.org/unifiedjs/unified-message-control
169
184
170
- [ coverage-badge ] : https://img.shields.io/codecov/c/github/remarkjs/remark -message-control.svg
185
+ [ coverage-badge ] : https://img.shields.io/codecov/c/github/unifiedjs/unified -message-control.svg
171
186
172
- [ coverage-status ] : https://codecov.io/github/remarkjs/remark -message-control
187
+ [ coverage-status ] : https://codecov.io/github/unifiedjs/unified -message-control
173
188
174
189
[ chat-badge ] : https://img.shields.io/gitter/room/unifiedjs/Lobby.svg
175
190
@@ -181,8 +196,10 @@ repository, organisation, or community you agree to abide by its terms.
181
196
182
197
[ npm ] : https://docs.npmjs.com/cli/install
183
198
184
- [ remark ] : https://github.com/remarkjs/remark
199
+ [ marker ] : https://github.com/syntax-tree/mdast-comment-marker#marker
200
+
201
+ [ unified ] : https://github.com/unifiedjs/unified
185
202
186
- [ contribute ] : https://github.com/remarkjs/remark /blob/master/contributing.md
203
+ [ contribute ] : https://github.com/unifiedjs/unified /blob/master/contributing.md
187
204
188
- [ coc ] : https://github.com/remarkjs/remark /blob/master/code-of-conduct.md
205
+ [ coc ] : https://github.com/unifiedjs/unified /blob/master/code-of-conduct.md
0 commit comments