1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
//! Use HTML text content elements to organize blocks or sections of content
//! placed between the opening `<body>` and closing `</body>` tags. Important
//! for accessibility and SEO, these elements identify the purpose or structure
//! of that content.

html_element! {
    /// The [HTML `<blockquote>` element][mdn] (or *HTML Block Quotation Element*) indicates that
    /// the enclosed text is an extended quotation. Usually, this is rendered visually by
    /// indentation. A URL for the source of the quotation may be given using the `cite` attribute,
    /// while a text representation of the source can be given using the [`<cite>`][cite] element.
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote
    /// [cite]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/cite
    <blockquote>

    categories {
        Flow, Sectioning, Palpable
    }

    children {
        categories {
            Flow
        }
    }

    attributes {
        /// A URL that designates a source document or message for the information quoted. This
        /// attribute is intended to point to information explaining the context or the reference
        /// for the quote.
        cite
    }
}

html_element! {
    /// The [HTML `<dd>` element][mdn] provides the description, definition, or value for the
    /// preceding term ([`<dt>`][dt]) in a description list ([`<dl>`][dl]).
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dd
    /// [dt]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt
    /// [dl]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl
    <dd>

    children {
        categories {
            Flow
        }
    }
}

html_element! {
    /// The [HTML Content Division element (`<div>`)][mdn] is the generic container for flow
    /// content. It has no effect on the content or layout until styled using [CSS].
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div
    /// [CSS]: https://developer.mozilla.org/en-US/docs/Glossary/CSS
    <div>

    categories {
        Flow, Palpable
    }

    children {
        categories {
            Flow
        }
    }
}

html_element! {
    /// The [HTML `<dl>` element][mdn] represents a description list. The element encloses a list of
    /// groups of terms (specified using the [`<dt>`][dt] element) and descriptions (provided by
    /// [`<dd>`][dd] elements). Common uses for this element are to implement a glossary or to
    /// display metadata (a list of key-value pairs).
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl
    /// [dt]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt
    /// [dd]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dd
    <dl>

    categories {
        Flow,
        Palpable // if children include one name-value group
    }

    children {
        tags {
            <script>, <template>,

            // and either:
            <div>,

            // or:
            <dt>, <dd>
        }
    }
}

html_element! {
    /// The [HTML `<dt>` element][mdn] specifies a term in a description or definition list, and as
    /// such must be used inside a [`<dl>`][dl] element.
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt
    /// [dl]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl
    <dt>

    children {
        categories {
            Flow // no header, footer, sectioning, or heading descendants
        }
    }
}

html_element! {
    /// The [HTML `<figcaption>` or Figure Caption element][mdn] represents a caption or legend
    /// describing the rest of the contents of its parent [`<figure>`][figure] element.
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption
    /// [figure]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure
    <figcaption>

    children {
        categories {
            Flow
        }
    }
}

html_element! {
    /// The [HTML `<figure>` (Figure With Optional Caption) element][mdn] represents self-contained
    /// content, potentially with an optional caption, which is specified using the
    /// ([`<figcaption>`][figcaption]) element.
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure
    /// [figcaption]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption
    <figure>

    categories {
        Flow, Sectioning, Palpable
    }

    children {
        tags {
            <figcaption>
        }
        categories {
            Flow
        }
    }
}

html_element! {
    /// The [HTML `<hr>` element][mdn] represents a thematic break between paragraph-level elements:
    /// for example, a change of scene in a story, or a shift of topic within a section.
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr
    <hr>

    categories {
        Flow
    }
}

html_element! {
    /// The [HTML `<li>` element][mdn] is used to represent an item in a list.
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li
    <li>

    children {
        categories {
            Flow
        }
    }
}

html_element! {
    /// The [HTML `<ol>` element][mdn] represents an ordered list of items, typically rendered as a
    /// numbered list.
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol
    <ol>

    categories {
        Flow,
        Palpable // if children include at least one <li>
    }

    children {
        tags {
            <li>, <script>, <template>
        }
    }

    attributes {
        /// Specifies that the list’s items are in reverse order. Items will be numbered from high
        /// to low.
        reversed(bool)

        /// An integer to start counting from for the list items. Always an Arabic numeral (1, 2, 3,
        /// etc.), even when the numbering type is letters or Roman numerals. For example, to start
        /// numbering elements from the letter "d" or the Roman numeral "iv," use start="4".
        start(u32)

        /// Sets the numbering type:
        ///
        /// * `a` for lowercase letters
        /// * `A` for uppercase letters
        /// * `i` for lowercase Roman numerals
        /// * `I` for uppercase Roman numerals
        /// * `1` for numbers (default)
        ///
        /// The specified type is used for the entire list unless a different type attribute is used
        /// on an enclosed `<li>` element.
        ///
        /// > Note: Unless the type of the list number matters (like legal or technical documents
        /// where items are referenced by their number/letter), use the CSS list-style-type property
        /// instead.
        type_
    }
}

html_element! {
    /// The [HTML `<p>` element][mdn] represents a paragraph.
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p
    <p>

    categories {
        Flow, Palpable
    }

    children {
        categories {
            Phrasing
        }
    }
}

html_element! {
    /// The [HTML `<pre>` element][mdn] represents preformatted text which is to be presented
    /// exactly as written in the HTML file.
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre
    <pre>

    categories {
        Flow, Palpable
    }

    children {
        categories {
            Phrasing
        }
    }
}

html_element! {
    /// The [HTML `<ul>` element][mdn] represents an unordered list of items, typically rendered as
    /// a bulleted list.
    ///
    /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul
    <ul>

    categories {
        Flow,
        Palpable // if children include at least 1 <li>
    }

    children {
        tags {
            <li>, <script>, <template>
        }
    }
}