55[ ![ Downloads] [ downloads-badge ]] [ downloads ]
66[ ![ Size] [ size-badge ]] [ size ]
77
8- Helper for creating [ ** unist** ] [ unist ] trees with [ hyperscript] [ ] -like syntax.
8+ [ ** unist** ] [ unist ] utility to create a new [ tree] [ ] s with [ hyperscript] [ ] -like
9+ syntax.
910
10- ## Installation
11+ ## Install
1112
1213[ npm] [ ] :
1314
@@ -23,8 +24,9 @@ var u = require('unist-builder')
2324var tree = u (' root' , [
2425 u (' subtree' , {id: 1 }),
2526 u (' subtree' , {id: 2 }, [
26- u (' node' , [u (' leaf' , ' leaf-1' ), u (' leaf' , ' leaf-2' )]),
27- u (' leaf' , {id: 3 }, ' leaf-3' )
27+ u (' node' , [u (' leaf' , ' leaf 1' ), u (' leaf' , ' leaf 2' )]),
28+ u (' leaf' , {id: 3 }, ' leaf 3' ),
29+ u (' void' , {id: 4 })
2830 ])
2931])
3032
@@ -45,11 +47,12 @@ results in the following tree:
4547 {
4648 type: ' node' ,
4749 children: [
48- {type: ' leaf' , value: ' leaf- 1' },
49- {type: ' leaf' , value: ' leaf- 2' }
50+ {type: ' leaf' , value: ' leaf 1' },
51+ {type: ' leaf' , value: ' leaf 2' }
5052 ]
5153 },
52- {type: ' leaf' , id: 3 , value: ' leaf-3' }
54+ {type: ' leaf' , id: 3 , value: ' leaf 3' },
55+ {type: ' void' , id: 4 }
5356 ]
5457 }
5558 ]
@@ -65,7 +68,7 @@ Creates a node from `props`, `children`, and optionally `value`.
6568###### Signatures
6669
6770* ` u(type[, props], children) ` — create a [ parent] [ ]
68- * ` u(type[, props], value) ` — create a [ text ] [ ]
71+ * ` u(type[, props], value) ` — create a [ literal ] [ ]
6972* ` u(type[, props]) ` — create a void node
7073
7174###### Parameters
@@ -88,11 +91,13 @@ Creates a node from `props`, `children`, and optionally `value`.
8891
8992## Contribute
9093
91- See [ ` contributing.md ` in ` syntax-tree/unist ` ] [ contributing ] for ways to get
94+ See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
9295started.
96+ See [ ` support.md ` ] [ support ] for ways to get help.
9397
94- This organisation has a [ Code of Conduct] [ coc ] . By interacting with this
95- repository, organisation, or community you agree to abide by its terms.
98+ This project has a [ Code of Conduct] [ coc ] .
99+ By interacting with this repository, organisation, or community you agree to
100+ abide by its terms.
96101
97102## License
98103
@@ -120,9 +125,11 @@ repository, organisation, or community you agree to abide by its terms.
120125
121126[ license ] : license
122127
123- [ contributing ] : https://github.com/syntax-tree/unist /blob/master/contributing.md
128+ [ contributing ] : https://github.com/syntax-tree/.github /blob/master/contributing.md
124129
125- [ coc ] : https://github.com/syntax-tree/unist/blob/master/code-of-conduct.md
130+ [ support ] : https://github.com/syntax-tree/.github/blob/master/support.md
131+
132+ [ coc ] : https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
126133
127134[ unist ] : https://github.com/syntax-tree/unist
128135
@@ -132,8 +139,10 @@ repository, organisation, or community you agree to abide by its terms.
132139
133140[ node ] : https://github.com/syntax-tree/unist#node
134141
142+ [ tree ] : https://github.com/syntax-tree/unist#tree
143+
135144[ parent ] : https://github.com/syntax-tree/unist#parent
136145
137- [ text ] : https://github.com/syntax-tree/unist#text
146+ [ literal ] : https://github.com/syntax-tree/unist#literal
138147
139148[ type ] : https://github.com/syntax-tree/unist#type
0 commit comments