11 | %hide Language.Reflection.TT.Name
14 | %language ElabReflection
16 | --------------------------------------------------------------------------------
17 | -- Utils
18 | --------------------------------------------------------------------------------
20 | ||| Joins lists.
21 | |||
22 | ||| Using the `>>` operator allows the use of the `do` syntax.
29 | ||| Joins Either.
30 | |||
31 | ||| Using the `>>` operator allows the use of the `do` syntax.
41 | --------------------------------------------------------------------------------
42 | -- Types
43 | --------------------------------------------------------------------------------
45 | export
56 | ||| Escape a `String` for use a attribute's value.
57 | |||
58 | ||| The following characters are escaped: '"', '\'', '&' and '<'.
59 | ||| This function is the only way to construct a `EscapedValue` as the
60 | ||| `EscapedValue` constructor is kept private.
61 | export
64 | where
74 | ||| A dynamic script such as a Javascript.
75 | export
86 | ||| Escapes the content of a script.
87 | |||
88 | ||| This follows the recommendations set in the [HTML specification][1].
89 | |||
90 | ||| [1]: https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements
91 | export
94 | where
105 | ||| CSS.
106 | export
117 | ||| Escapes CSS content.
118 | export
121 | where
129 | ||| A HTML element.
132 | ||| A normal element with attributes and children elements.
135 | ||| An element without any children elements.
138 | ||| Plain text content.
141 | ||| Script content.
144 | ||| Css content.
147 | ||| Unescaped HTML code.
152 | ||| Converts a string to a plain text element.
153 | |||
154 | ||| The string is escaped with the `escape` function.
159 | ||| Converts a string to a list with a single plain text element.
160 | |||
161 | ||| Notes:
162 | ||| - The string is escaped with the `escape` function.
168 | ||| Returns an element's name.
178 | ||| Returns names of an elements' list.
184 | ||| Returns the list of attributes of an element.
191 | ||| List of the metadata elements.
192 | |||
193 | ||| Such elements are accepted as children of the `head` element.
205 | ]
207 | ||| Embedded content elements.
208 | |||
209 | ||| The list is as per [the one of MDN][1].
210 | |||
211 | ||| [1]: https://developer.mozilla.org/docs/Web/HTML/Guides/Content_categories#embedded_content
225 | ]
227 | ||| Flow content elements including plain text.
228 | |||
229 | ||| The list is as per [the one of MDN][1].
230 | |||
231 | ||| [1]: https://developer.mozilla.org/docs/Web/HTML/Guides/Content_categories#flow_content
321 | ]
323 | ||| Interactive content elements.
324 | |||
325 | ||| The list is as per [the one of MDN][1].
326 | |||
327 | ||| [1]: https://developer.mozilla.org/docs/Web/HTML/Guides/Content_categories#interactive_content
338 | ]
340 | ||| Phrasing content elements including plain text.
341 | |||
342 | ||| Elements valid only in certain conditions are also included.
343 | |||
344 | ||| The list is as per [the one of MDN][1].
345 | |||
346 | ||| [1]: https://developer.mozilla.org/docs/Web/HTML/Guides/Content_categories#phrasing_content
407 | ]
409 | ||| Heading content.
410 | |||
411 | ||| **h1** to **h6** or **hgroup** elements.
416 | ||| Sectioning content.
417 | |||
418 | ||| **article**, **aside**, **nav** or **section** elements.
423 | ||| Content accepted by lists type elements (**ul** or **ol**).
428 | ||| A doctype preamble.
429 | |||
430 | ||| Note: currently only the HTML 5 one is available, but this could potentially
431 | ||| be extended.
435 | ||| A HTML document.
440 | ||| Doctype preamble.
443 | ||| Root HTML element.