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 ]
210
311[ ** mdast** ] [ mdast ] utility to treat HTML comments as ranges.
12+
413Useful in [ ** remark** ] [ remark ] plugins.
514
6- ## Installation
15+ ## Install
716
817[ npm] [ ] :
918
10- ``` bash
19+ ``` sh
1120npm install mdast-zone
1221```
1322
2534
2635And our script, ` example.js ` , looks as follows:
2736
28- ``` javascript
37+ ``` js
2938var vfile = require (' to-vfile' )
3039var remark = require (' remark' )
3140var zone = require (' mdast-zone' )
@@ -72,7 +81,7 @@ Search `tree` for comment ranges (“zones”).
7281
7382###### Parameters
7483
75- * ` tree ` ([ ` Node ` ] [ mdast ] ) — Node to search for ranges
84+ * ` tree ` ([ ` Node ` ] [ node ] ) — [ Tree ] [ ] to search for ranges
7685* ` name ` (` string ` ) — Name of ranges to search for
7786* ` handler ` ([ ` Function ` ] [ handler ] ) — Function invoked for each found range
7887
@@ -83,22 +92,24 @@ and the last `end`, and the content inside.
8392
8493###### Parameters
8594
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)
8998
9099###### Returns
91100
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 `
93102with, optional.
94103
95104## Contribute
96105
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
98107started.
108+ See [ ` support.md ` ] [ support ] for ways to get help.
99109
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.
102113
103114## License
104115
@@ -118,22 +129,40 @@ repository, organisation, or community you agree to abide by its terms.
118129
119130[ downloads ] : https://www.npmjs.com/package/mdast-zone
120131
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+
121142[ chat-badge ] : https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
122143
123- [ chat ] : https://spectrum.chat/unified/remark
144+ [ chat ] : https://spectrum.chat/unified/syntax-tree
124145
125146[ npm ] : https://docs.npmjs.com/cli/install
126147
127148[ license ] : license
128149
129150[ author ] : https://wooorm.com
130151
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+
131158[ mdast ] : https://github.com/syntax-tree/mdast
132159
133- [ remark ] : https://github.com/wooorm /remark
160+ [ remark ] : https://github.com/remarkjs /remark
134161
135162[ handler ] : #function-handlerstart-nodes-end
136163
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
138167
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