1
- # hast-util-to-dom [ ![ Build Status ] [ travis-badge ]] [ travis ]
1
+ # hast-util-to-dom
2
2
3
- Transform [ HAST] [ ] to a DOM tree
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 ]
4
10
5
- ## Installation
11
+ [ ** hast** ] [ hast ] utility to transform to a DOM tree.
12
+
13
+ ## Install
6
14
7
15
[ yarn] [ ] :
8
16
9
- ``` bash
17
+ ``` sh
10
18
yarn add hast-util-to-dom
11
19
```
12
20
13
21
[ npm] [ ] :
14
22
15
- ``` bash
23
+ ``` sh
16
24
npm install hast-util-to-dom
17
25
```
18
26
@@ -62,19 +70,70 @@ Buddy, that’s the web!
62
70
63
71
## API
64
72
65
- ### ` toDOM(node) `
73
+ ### ` toDOM(node[, options]) `
74
+
75
+ Transform a [ ** hast** ] [ hast ] [ * tree* ] [ tree ] to a DOM tree.
76
+
77
+ ##### ` options `
78
+
79
+ ###### ` options.fragment `
80
+
81
+ Whether a DOM fragment should be returned (default: ` false ` ).
82
+
83
+ ###### ` options.namespace `
84
+
85
+ ` namespace ` to use to create [ * elements* ] [ element ] .
66
86
67
- Transform a [ HAST Node] [ node ] to DOM ` Node ` .
87
+ ## Related
88
+
89
+ * [ ` hast-util-sanitize ` ] ( https://github.com/syntax-tree/hast-util-sanitize )
90
+ — Sanitize hast nodes
91
+ * [ ` hast-util-to-html ` ] ( https://github.com/syntax-tree/hast-util-to-html )
92
+ — Create an HTML string
93
+ * [ ` hast-util-from-dom ` ] ( https://github.com/syntax-tree/hast-util-from-dom )
94
+ — Create a hast tree from a DOM tree
95
+
96
+ ## Contribute
97
+
98
+ See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
99
+ started.
100
+ See [ ` support.md ` ] [ support ] for ways to get help.
101
+
102
+ This project has a [ Code of Conduct] [ coc ] .
103
+ By interacting with this repository, organisation, or community you agree to
104
+ abide by its terms.
68
105
69
106
## License
70
107
71
108
[ ISC] [ license ] © [ Keith McKnight] [ author ]
72
109
73
110
<!-- Definitions -->
74
111
75
- [ travis-badge ] : https://img.shields.io/travis/syntax-tree/hast-util-to-dom.svg
112
+ [ build-badge ] : https://img.shields.io/travis/syntax-tree/hast-util-to-dom.svg
113
+
114
+ [ build ] : https://travis-ci.org/syntax-tree/hast-util-to-dom
115
+
116
+ [ coverage-badge ] : https://img.shields.io/codecov/c/github/syntax-tree/hast-util-to-dom.svg
76
117
77
- [ travis ] : https://travis-ci.org/syntax-tree/hast-util-to-dom
118
+ [ coverage ] : https://codecov.io/github/syntax-tree/hast-util-to-dom
119
+
120
+ [ downloads-badge ] : https://img.shields.io/npm/dm/hast-util-to-dom.svg
121
+
122
+ [ downloads ] : https://www.npmjs.com/package/hast-util-to-dom
123
+
124
+ [ size-badge ] : https://img.shields.io/bundlephobia/minzip/hast-util-to-dom.svg
125
+
126
+ [ size ] : https://bundlephobia.com/result?p=hast-util-to-dom
127
+
128
+ [ sponsors-badge ] : https://opencollective.com/unified/sponsors/badge.svg
129
+
130
+ [ backers-badge ] : https://opencollective.com/unified/backers/badge.svg
131
+
132
+ [ collective ] : https://opencollective.com/unified
133
+
134
+ [ chat-badge ] : https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
135
+
136
+ [ chat ] : https://spectrum.chat/unified/syntax-tree
78
137
79
138
[ yarn ] : https://yarnpkg.com/lang/en/docs/install
80
139
@@ -84,6 +143,14 @@ Transform a [HAST Node][node] to DOM `Node`.
84
143
85
144
[ author ] : https://keith.mcknig.ht
86
145
146
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/master/contributing.md
147
+
148
+ [ support ] : https://github.com/syntax-tree/.github/blob/master/support.md
149
+
150
+ [ coc ] : https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
151
+
87
152
[ hast ] : https://github.com/syntax-tree/hast
88
153
89
- [ node ] : https://github.com/syntax-tree/hast#ast
154
+ [ element ] : https://github.com/syntax-tree/hast#element
155
+
156
+ [ tree ] : https://github.com/syntax-tree/unist#tree
0 commit comments