8
8
[ ![ Backers] [ backers-badge ]] [ collective ]
9
9
[ ![ Chat] [ chat-badge ]] [ chat ]
10
10
11
- [ ** hast** ] [ hast ] utility to check if an [ * element* ] [ element ] is a
12
- [ * heading* ] [ spec ] .
11
+ [ hast] [ ] utility to check if a node is a [ * heading* ] [ spec ] .
13
12
14
- ## Install
13
+ ## Contents
14
+
15
+ * [ When should I use this?] ( #when-should-i-use-this )
16
+ * [ Install] ( #install )
17
+ * [ Use] ( #use )
18
+ * [ API] ( #api )
19
+ * [ ` heading(node) ` ] ( #headingnode )
20
+ * [ Types] ( #types )
21
+ * [ Compatibility] ( #compatibility )
22
+ * [ Security] ( #security )
23
+ * [ Related] ( #related )
24
+ * [ Contribute] ( #contribute )
25
+ * [ License] ( #license )
26
+
27
+ ## When should I use this?
15
28
16
- This package is [ ESM only] ( https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c ) :
17
- Node 12+ is needed to use it and it must be ` import ` ed instead of ` require ` d.
29
+ This utility is super niche, if you’re here you probably know what you’re
30
+ looking for!
31
+
32
+ ## Install
18
33
19
- [ npm] [ ] :
34
+ This package is [ ESM only] [ esm ] .
35
+ In Node.js (version 12.20+, 14.14+, 16.0+, or 18.0+), install with [ npm] [ ] :
20
36
21
37
``` sh
22
38
npm install hast-util-heading
23
39
```
24
40
41
+ In Deno with [ ` esm.sh ` ] [ esmsh ] :
42
+
43
+ ``` js
44
+ import {heading } from ' https://esm.sh/hast-util-heading@2'
45
+ ```
46
+
47
+ In browsers with [ ` esm.sh ` ] [ esmsh ] :
48
+
49
+ ``` html
50
+ <script type =" module" >
51
+ import {heading } from ' https://esm.sh/hast-util-heading@2?bundle'
52
+ </script >
53
+ ```
54
+
25
55
## Use
26
56
27
57
``` js
@@ -45,13 +75,25 @@ heading({
45
75
46
76
## API
47
77
48
- This package exports the following identifiers: ` heading ` .
78
+ This package exports the identifier ` heading ` .
49
79
There is no default export.
50
80
51
81
### ` heading(node) `
52
82
53
83
Check if the given value is a [ * heading* ] [ spec ] [ * element* ] [ element ] .
54
84
85
+ ## Types
86
+
87
+ This package is fully typed with [ TypeScript] [ ] .
88
+ It exports no additional types.
89
+
90
+ ## Compatibility
91
+
92
+ Projects maintained by the unified collective are compatible with all maintained
93
+ versions of Node.js.
94
+ As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18.0+.
95
+ Our projects sometimes work with older versions, but this is not guaranteed.
96
+
55
97
## Security
56
98
57
99
` hast-util-heading ` does not change the syntax tree so there are no openings for
@@ -67,19 +109,19 @@ Check if the given value is a [*heading*][spec] [*element*][element].
67
109
— check if a node is a (certain) element
68
110
* [ ` hast-util-has-property ` ] ( https://github.com/syntax-tree/hast-util-has-property )
69
111
— check if a node has a property
70
- * [ ` hast-util-is-body-ok-link ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-body-ok-link )
112
+ * [ ` hast-util-is-body-ok-link ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-body-ok-link )
71
113
— check if a node is “Body OK” link element
72
- * [ ` hast-util-is-conditional-comment ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-conditional-comment )
114
+ * [ ` hast-util-is-conditional-comment ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-conditional-comment )
73
115
— check if a node is a conditional comment
74
- * [ ` hast-util-is-css-link ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-css-link )
116
+ * [ ` hast-util-is-css-link ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-css-link )
75
117
— check if a node is a CSS link element
76
- * [ ` hast-util-is-css-style ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-css-style )
118
+ * [ ` hast-util-is-css-style ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-css-style )
77
119
— check if a node is a CSS style element
78
120
* [ ` hast-util-embedded ` ] ( https://github.com/syntax-tree/hast-util-embedded )
79
121
— check if a node is an embedded element
80
122
* [ ` hast-util-interactive ` ] ( https://github.com/syntax-tree/hast-util-interactive )
81
123
— check if a node is interactive
82
- * [ ` hast-util-is-javascript ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-javascript )
124
+ * [ ` hast-util-is-javascript ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-javascript )
83
125
— check if a node is a JavaScript script element
84
126
* [ ` hast-util-labelable ` ] ( https://github.com/syntax-tree/hast-util-labelable )
85
127
— check whether a node is labelable
@@ -96,8 +138,8 @@ Check if the given value is a [*heading*][spec] [*element*][element].
96
138
97
139
## Contribute
98
140
99
- See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
100
- started.
141
+ See [ ` contributing.md ` ] [ contributing ] in [ ` syntax-tree/.github ` ] [ health ] for
142
+ ways to get started.
101
143
See [ ` support.md ` ] [ support ] for ways to get help.
102
144
103
145
This project has a [ code of conduct] [ coc ] .
@@ -138,15 +180,23 @@ abide by its terms.
138
180
139
181
[ npm ] : https://docs.npmjs.com/cli/install
140
182
183
+ [ esm ] : https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
184
+
185
+ [ esmsh ] : https://esm.sh
186
+
187
+ [ typescript ] : https://www.typescriptlang.org
188
+
141
189
[ license ] : license
142
190
143
191
[ author ] : https://wooorm.com
144
192
145
- [ contributing ] : https://github.com/syntax-tree/.github/blob/HEAD/contributing.md
193
+ [ health ] : https://github.com/syntax-tree/.github
194
+
195
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/main/contributing.md
146
196
147
- [ support ] : https://github.com/syntax-tree/.github/blob/HEAD /support.md
197
+ [ support ] : https://github.com/syntax-tree/.github/blob/main /support.md
148
198
149
- [ coc ] : https://github.com/syntax-tree/.github/blob/HEAD /code-of-conduct.md
199
+ [ coc ] : https://github.com/syntax-tree/.github/blob/main /code-of-conduct.md
150
200
151
201
[ spec ] : https://html.spec.whatwg.org/#heading-content
152
202
0 commit comments