4
4
5
5
***
6
6
7
- > :information_desk_person : I’m working on ** rehype** , which uses
8
- > this format. A very alpha version of rehype was previously
9
- > published here as ` hast ` . It’s still published on
10
- > [ npm] ( http://npmjs.com/hast ) though. ** rehype** will be published
11
- > soon.
12
- >
13
- > Early feedback is greatly appreciated!
14
-
15
7
** HAST** discloses HTML as an abstract syntax tree. _ Abstract_
16
8
means not all information is stored in this tree and an exact replica
17
9
of the original document cannot be re-created. _ Syntax Tree_ means syntax
18
10
** is** present in the tree, thus an exact syntactic document can be
19
11
re-created.
20
12
21
- The reason for introducing a new “virtual” DOM is manyfold, primarily:
13
+ The reason for introducing a new “virtual” DOM is primarily:
22
14
23
15
* The DOM is very heavy to implement outside of the browser;
24
16
a lean, stripped down virtual DOM can be used everywhere;
@@ -30,62 +22,49 @@ The reason for introducing a new “virtual” DOM is manyfold, primarily:
30
22
31
23
* Neither HTML nor virtual DOMs focus on positional information.
32
24
33
- ** HAST** is a subset of [ Unist] [ ] .
34
-
35
- ## List of Utilities
25
+ ** HAST** is a subset of [ Unist] [ ] , and implemented by [ rehype] [ ] .
36
26
37
- <!-- Special -->
27
+ This document describes version 0.1.0 of ** HAST ** . [ Changelog » ] [ changelog ] .
38
28
39
- * [ ` wooorm/hastscript ` ] ( https://github.com/wooorm/hastscript )
40
- — Hyperscript compatible DSL for creating nodes;
29
+ ## List of Utilities
41
30
42
- * [ ` wooorm/hast-to-hyperscript ` ] ( https://github.com/wooorm/hast-to-hyperscript )
43
- — Convert a HAST Node through to React, Virtual DOM, Hyperscript, and more;
31
+ <!-- lint disable list-item-spacing-->
44
32
45
33
<!--
46
- Normal utilities . Sorted alphabetically based on content
47
- after `hast-util-`
34
+ Utilities . The first two are special. The rest is sorted
35
+ alphabetically based on content after `hast-util-`
48
36
-->
49
37
38
+ * [ ` wooorm/hastscript ` ] ( https://github.com/wooorm/hastscript )
39
+ — Hyperscript compatible DSL for creating nodes;
40
+ * [ ` wooorm/hast-to-hyperscript ` ] ( https://github.com/wooorm/hast-to-hyperscript )
41
+ — Convert a Node to React, Virtual DOM, Hyperscript, and more;
50
42
* [ ` wooorm/hast-util-embedded ` ] ( https://github.com/wooorm/hast-util-embedded )
51
43
— Check if a node is embedded content;
52
-
53
44
* [ ` wooorm/hast-util-has-property ` ] ( https://github.com/wooorm/hast-util-has-property )
54
45
— Check if a node has a property;
55
-
56
46
* [ ` wooorm/hast-util-heading ` ] ( https://github.com/wooorm/hast-util-heading )
57
47
— Check if a node is heading content;
58
-
59
48
* [ ` wooorm/hast-util-interactive ` ] ( https://github.com/wooorm/hast-util-interactive )
60
49
— Check if a node is interactive;
61
-
62
50
* [ ` wooorm/hast-util-is-element ` ] ( https://github.com/wooorm/hast-util-is-element )
63
51
— Check if a node is a (certain) element;
64
-
65
52
* [ ` wooorm/hast-util-labelable ` ] ( https://github.com/wooorm/hast-util-labelable )
66
53
— Check if a node is labelable;
67
-
68
54
* [ ` wooorm/hast-util-menu-state ` ] ( https://github.com/wooorm/hast-util-menu-state )
69
55
— Check the state of a menu element;
70
-
71
56
* [ ` wooorm/hast-util-parse-selector ` ] ( https://github.com/wooorm/hast-util-parse-selector )
72
57
— Create a node from a simple CSS selector;
73
-
74
58
* [ ` wooorm/hast-util-sanitize ` ] ( https://github.com/wooorm/hast-util-sanitize )
75
59
— Sanitise nodes;
76
-
77
60
* [ ` wooorm/hast-util-script-supporting ` ] ( https://github.com/wooorm/hast-util-script-supporting )
78
61
— Check if a node is script-supporting content;
79
-
80
62
* [ ` wooorm/hast-util-sectioning ` ] ( https://github.com/wooorm/hast-util-sectioning )
81
63
— Check if a node is sectioning content;
82
-
83
64
* [ ` wooorm/hast-util-to-html ` ] ( https://github.com/wooorm/hast-util-to-html )
84
65
— Stringify nodes to HTML;
85
-
86
66
* [ ` wooorm/hast-util-transparent ` ] ( https://github.com/wooorm/hast-util-transparent )
87
67
— Check if a node is transparent content;
88
-
89
68
* [ ` wooorm/hast-util-whitespace ` ] ( https://github.com/wooorm/hast-util-whitespace )
90
69
— Check if a node is inter-element whitespace;
91
70
@@ -189,15 +168,15 @@ The DOM is strict in reflecting those properties, and HAST is not,
189
168
where the DOM treats ` <div hidden=no></div> ` as having a ` true `
190
169
(boolean) value for the ` hidden ` attribute, and ` <img width="yes"> `
191
170
as having a ` 0 ` (number) value for the ` width ` attribute, these should
192
- be reflected as ` "no" ` and ` " yes" ` , respectively, in HAST.
171
+ be reflected as ` 'no' ` and ` ' yes' ` , respectively, in HAST.
193
172
194
173
> The reason for this is to allow plug-ins and utilities to inspect
195
174
> these values.
196
175
197
176
The DOM also specifies comma- and space-separated lists attribute
198
177
values. In HAST, these should be treated as ordered lists. For example,
199
178
` <div class="alpha bravo"></div> ` is represented as
200
- ` [" alpha", " bravo" ] ` .
179
+ ` [' alpha', ' bravo' ] ` .
201
180
202
181
> There’s no special format for ` style ` .
203
182
@@ -313,15 +292,17 @@ Yields:
313
292
314
293
## Related
315
294
295
+ * [ rehype] [ ]
316
296
* [ Unist] [ ]
317
- * [ vfile] [ ]
318
- * rehype
297
+ * [ VFile] [ ]
298
+ * [ NLCST] [ ]
299
+ * [ MDAST] [ ]
319
300
320
301
<!-- Definitions -->
321
302
322
303
[ logo ] : https://cdn.rawgit.com/wooorm/hast/master/logo.svg
323
304
324
- [ vfile ] : https://github.com/wooorm/vfile
305
+ [ changelog ] : https://github.com/wooorm/hast/releases
325
306
326
307
[ html-element ] : https://dom.spec.whatwg.org/#interface-element
327
308
@@ -333,4 +314,12 @@ Yields:
333
314
334
315
[ text ] : https://github.com/wooorm/unist#text
335
316
317
+ [ rehype ] : https://github.com/wooorm/rehype
318
+
319
+ [ nlcst ] : https://github.com/wooorm/nlcst
320
+
321
+ [ mdast ] : https://github.com/wooorm/mdast
322
+
323
+ [ vfile ] : https://github.com/wooorm/vfile
324
+
336
325
[ properties ] : #properties
0 commit comments