8
8
[ ![ Backers] [ backers-badge ]] [ collective ]
9
9
[ ![ Chat] [ chat-badge ]] [ chat ]
10
10
11
- [ hast] [ ] utility to transform to get the rank (also known as depth or level) of
12
- headings.
11
+ [ hast] [ ] utility to get the rank (also known as depth or level) of headings.
13
12
14
13
## Contents
15
14
@@ -28,8 +27,8 @@ headings.
28
27
29
28
## What is this?
30
29
31
- This package is a utility that lets you get the rank (` 1.. 6 ` ) of heading
32
- elements (` h1.. h6 ` ).
30
+ This package is a utility that lets you get the rank (` 1 ` , ` 6 ` ) of heading
31
+ elements (` h1 ` , ` h6 ` ).
33
32
34
33
## When should I use this?
35
34
@@ -42,7 +41,7 @@ To change heading ranks, use
42
41
## Install
43
42
44
43
This package is [ ESM only] [ esm ] .
45
- In Node.js (version 12.20+, 14.14+, 16.0+, or 18 .0+), install with [ npm] [ ] :
44
+ In Node.js (version 14.14+ and 16 .0+), install with [ npm] [ ] :
46
45
47
46
``` sh
48
47
npm install hast-util-heading-rank
@@ -74,7 +73,7 @@ headingRank(h('h5', 'Alpha')) //=> 5
74
73
75
74
## API
76
75
77
- This package exports the identifier ` headingRank ` .
76
+ This package exports the identifier [ ` headingRank ` ] [ headingrank ] .
78
77
There is no default export.
79
78
80
79
### ` headingRank(node) `
@@ -83,7 +82,8 @@ Get the rank (`1` to `6`) of headings (`h1` to `h6`).
83
82
84
83
###### Parameters
85
84
86
- * ` node ` ([ ` Node ` ] [ node ] ) — node to check
85
+ * ` node ` ([ ` Node ` ] [ node ] )
86
+ — node to check
87
87
88
88
###### Returns
89
89
@@ -98,7 +98,7 @@ It exports no additional types.
98
98
99
99
Projects maintained by the unified collective are compatible with all maintained
100
100
versions of Node.js.
101
- As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18 .0+.
101
+ As of now, that is Node.js 14.14+ and 16 .0+.
102
102
Our projects sometimes work with older versions, but this is not guaranteed.
103
103
104
104
## Security
@@ -182,3 +182,5 @@ abide by its terms.
182
182
[ xss ] : https://en.wikipedia.org/wiki/Cross-site_scripting
183
183
184
184
[ hast-util-shift-heading ] : https://github.com/syntax-tree/hast-util-shift-heading
185
+
186
+ [ headingrank ] : #headingranknode
0 commit comments