1
- # mdast-zone [ ![ Build] [ build-badge ]] [ build ] [ ![ Coverage] [ coverage-badge ]] [ coverage ] [ ![ Downloads] [ downloads-badge ]] [ downloads ] [ ![ Chat] [ chat-badge ]] [ chat ]
1
+ # mdast-zone
2
+
3
+ [ ![ Build] [ build-badge ]] [ build ]
4
+ [ ![ Coverage] [ coverage-badge ]] [ coverage ]
5
+ [ ![ Downloads] [ downloads-badge ]] [ downloads ]
6
+ [ ![ Size] [ size-badge ]] [ size ]
7
+ [ ![ Sponsors] [ sponsors-badge ]] [ collective ]
8
+ [ ![ Backers] [ backers-badge ]] [ collective ]
9
+ [ ![ Chat] [ chat-badge ]] [ chat ]
2
10
3
11
[ ** mdast** ] [ mdast ] utility to treat HTML comments as ranges.
12
+
4
13
Useful in [ ** remark** ] [ remark ] plugins.
5
14
6
- ## Installation
15
+ ## Install
7
16
8
17
[ npm] [ ] :
9
18
10
- ``` bash
19
+ ``` sh
11
20
npm install mdast-zone
12
21
```
13
22
25
34
26
35
And our script, ` example.js ` , looks as follows:
27
36
28
- ``` javascript
37
+ ``` js
29
38
var vfile = require (' to-vfile' )
30
39
var remark = require (' remark' )
31
40
var zone = require (' mdast-zone' )
@@ -72,7 +81,7 @@ Search `tree` for comment ranges (“zones”).
72
81
73
82
###### Parameters
74
83
75
- * ` tree ` ([ ` Node ` ] [ mdast ] ) — Node to search for ranges
84
+ * ` tree ` ([ ` Node ` ] [ node ] ) — [ Tree ] [ ] to search for ranges
76
85
* ` name ` (` string ` ) — Name of ranges to search for
77
86
* ` handler ` ([ ` Function ` ] [ handler ] ) — Function invoked for each found range
78
87
@@ -83,22 +92,24 @@ and the last `end`, and the content inside.
83
92
84
93
###### Parameters
85
94
86
- * ` start ` ([ ` Node ` ] [ mdast ] ) — Start of range (an HTML comment node)
87
- * ` nodes ` (` Array.<Node> ` ) — Nodes between ` start ` and ` end `
88
- * ` end ` ([ ` Node ` ] [ mdast ] ) — End of range (an HTML comment node)
95
+ * ` start ` ([ ` Node ` ] [ node ] ) — Start of range (an [ HTML] [ ] comment node)
96
+ * ` nodes ` ([ ` Array.<Node> ` ] [ node ] ) — Nodes between ` start ` and ` end `
97
+ * ` end ` ([ ` Node ` ] [ node ] ) — End of range (an [ HTML] [ ] comment node)
89
98
90
99
###### Returns
91
100
92
- ` Array.<Node>? ` — List of nodes to replace ` start ` , ` nodes ` , and ` end `
101
+ [ ` Array.<Node>? ` ] [ node ] — List of nodes to replace ` start ` , ` nodes ` , and ` end `
93
102
with, optional.
94
103
95
104
## Contribute
96
105
97
- See [ ` contributing.md ` in ` syntax-tree/mdast ` ] [ contributing ] for ways to get
106
+ See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
98
107
started.
108
+ See [ ` support.md ` ] [ support ] for ways to get help.
99
109
100
- This organisation has a [ Code of Conduct] [ coc ] . By interacting with this
101
- repository, organisation, or community you agree to abide by its terms.
110
+ This project has a [ Code of Conduct] [ coc ] .
111
+ By interacting with this repository, organisation, or community you agree to
112
+ abide by its terms.
102
113
103
114
## License
104
115
@@ -118,22 +129,40 @@ repository, organisation, or community you agree to abide by its terms.
118
129
119
130
[ downloads ] : https://www.npmjs.com/package/mdast-zone
120
131
132
+ [ size-badge ] : https://img.shields.io/bundlephobia/minzip/mdast-zone.svg
133
+
134
+ [ size ] : https://bundlephobia.com/result?p=mdast-zone
135
+
136
+ [ sponsors-badge ] : https://opencollective.com/unified/sponsors/badge.svg
137
+
138
+ [ backers-badge ] : https://opencollective.com/unified/backers/badge.svg
139
+
140
+ [ collective ] : https://opencollective.com/unified
141
+
121
142
[ chat-badge ] : https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
122
143
123
- [ chat ] : https://spectrum.chat/unified/remark
144
+ [ chat ] : https://spectrum.chat/unified/syntax-tree
124
145
125
146
[ npm ] : https://docs.npmjs.com/cli/install
126
147
127
148
[ license ] : license
128
149
129
150
[ author ] : https://wooorm.com
130
151
152
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/master/contributing.md
153
+
154
+ [ support ] : https://github.com/syntax-tree/.github/blob/master/support.md
155
+
156
+ [ coc ] : https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
157
+
131
158
[ mdast ] : https://github.com/syntax-tree/mdast
132
159
133
- [ remark ] : https://github.com/wooorm /remark
160
+ [ remark ] : https://github.com/remarkjs /remark
134
161
135
162
[ handler ] : #function-handlerstart-nodes-end
136
163
137
- [ contributing ] : https://github.com/syntax-tree/mdast/blob/master/contributing.md
164
+ [ node ] : https://github.com/syntax-tree/mdast#nodes
165
+
166
+ [ tree ] : https://github.com/syntax-tree/unist#tree
138
167
139
- [ coc ] : https://github.com/syntax-tree/mdast/blob/master/code-of-conduct.md
168
+ [ html ] : https://github.com/syntax-tree/mdast#html
0 commit comments