10
10
11
11
[ ** hast** ] [ hast ] utility to create [ * trees* ] [ tree ] in HTML or SVG.
12
12
13
- Similar to [ hyperscript] [ ] (and [ ` virtual-hyperscript ` ] [ virtual-hyperscript ] )
13
+ Similar to [ ` hyperscript ` ] [ hyperscript ] , [ ` virtual-dom/h ` ] [ virtual-hyperscript ] ,
14
+ [ ` React.createElement ` ] [ react ] , and [ Vue’s ` createElement ` ] [ vue ] ,
14
15
but for [ ** hast** ] [ hast ] .
15
16
17
+ Use [ ` unist-builder ` ] [ u ] to create any [ ** unist** ] [ unist ] tree.
18
+
16
19
## Install
17
20
18
21
[ npm] [ ] :
@@ -21,7 +24,7 @@ but for [**hast**][hast].
21
24
npm install hastscript
22
25
```
23
26
24
- ## Usage
27
+ ## Use
25
28
26
29
``` js
27
30
var h = require (' hastscript' )
@@ -149,6 +152,7 @@ Simple CSS selector (`string`, optional).
149
152
Can contain a tag name (` foo ` ), IDs (` #bar ` ), and classes (` .baz ` ).
150
153
If there is no tag name in the selector, ` h ` defaults to a ` div ` element,
151
154
and ` s ` to a ` g ` element.
155
+ ` selector ` is parsed by [ ` hast-util-parse-selector ` ] [ parse-selector ] .
152
156
153
157
###### ` properties `
154
158
@@ -217,9 +221,15 @@ abide by its terms.
217
221
218
222
[ coc ] : https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
219
223
224
+ [ hyperscript ] : https://github.com/dominictarr/hyperscript
225
+
220
226
[ virtual-hyperscript ] : https://github.com/Matt-Esch/virtual-dom/tree/master/virtual-hyperscript
221
227
222
- [ hyperscript ] : https://github.com/dominictarr/hyperscript
228
+ [ react ] : https://reactjs.org/docs/glossary.html#react-elements
229
+
230
+ [ vue ] : https://vuejs.org/v2/guide/render-function.html#createElement-Arguments
231
+
232
+ [ unist ] : https://github.com/syntax-tree/unist
223
233
224
234
[ tree ] : https://github.com/syntax-tree/unist#tree
225
235
@@ -228,3 +238,7 @@ abide by its terms.
228
238
[ element ] : https://github.com/syntax-tree/hast#element
229
239
230
240
[ text ] : https://github.com/syntax-tree/hast#text
241
+
242
+ [ u ] : https://github.com/syntax-tree/unist-builder
243
+
244
+ [ parse-selector ] : https://github.com/syntax-tree/hast-util-parse-selector
0 commit comments