1#![allow(non_upper_case_globals, non_snake_case)]
12
13pub mod global_attributes {
19 pub const class: (&str, Option<&str>, bool) = ("class", None, false);
21 pub const id: (&str, Option<&str>, bool) = ("id", None, false);
23 pub const style: (&str, Option<&str>, bool) = ("style", None, false);
25 pub const title: (&str, Option<&str>, bool) = ("title", None, false);
27 pub const lang: (&str, Option<&str>, bool) = ("lang", None, false);
29 pub const dir: (&str, Option<&str>, bool) = ("dir", None, false);
31 pub const hidden: (&str, Option<&str>, bool) = ("hidden", None, false);
33 pub const tabindex: (&str, Option<&str>, bool) = ("tabindex", None, false);
35 pub const accesskey: (&str, Option<&str>, bool) = ("accesskey", None, false);
37 pub const draggable: (&str, Option<&str>, bool) = ("draggable", None, false);
39 pub const contenteditable: (&str, Option<&str>, bool) = ("contenteditable", None, false);
41 pub const spellcheck: (&str, Option<&str>, bool) = ("spellcheck", None, false);
43 pub const role: (&str, Option<&str>, bool) = ("role", None, false);
45}
46
47macro_rules! el {
52 ($doc:literal, $name:ident) => {
54 #[doc = $doc]
55 #[allow(non_camel_case_types)]
56 pub mod $name {
57 pub use super::global_attributes::*;
58 pub const TAG_NAME: &str = stringify!($name);
60 }
61 };
62 ($doc:literal, $name:ident, { $( $adoc:literal $attr:ident ),* $(,)? }) => {
64 #[doc = $doc]
65 #[allow(non_camel_case_types)]
66 pub mod $name {
67 pub use super::global_attributes::*;
68 pub const TAG_NAME: &str = stringify!($name);
70 $(
71 #[doc = $adoc]
72 pub const $attr: (&str, Option<&str>, bool) = (stringify!($attr), None, false);
73 )*
74 }
75 };
76}
77
78el!("The `<html>` root element.", html);
83el!("The `<head>` metadata container.", head);
84el!("The `<base>` element sets the base URL.", base, { "Base URL." href, "Default target." target });
85el!("The `<link>` element links external resources.", link, { "Resource URL." href, "Relationship type." rel, "Media query." media, "Icon sizes." sizes, "CORS mode." crossorigin, "SRI hash." integrity });
86el!("The `<meta>` element provides metadata.", meta, { "Character encoding." charset, "Metadata value." content, "Metadata name." name });
87el!("The `<style>` element contains CSS.", style, { "Media query." media });
88el!("The `<title>` element sets the document title.", title);
89el!("The `<body>` element contains document content.", body);
90
91el!("The `<address>` element — contact info.", address);
96el!("The `<article>` element — self-contained content.", article);
97el!("The `<aside>` element — tangential content.", aside);
98el!("The `<footer>` element — section footer.", footer);
99el!("The `<header>` element — introductory content.", header);
100el!("The `<h1>` heading (most important).", h1);
101el!("The `<h2>` heading.", h2);
102el!("The `<h3>` heading.", h3);
103el!("The `<h4>` heading.", h4);
104el!("The `<h5>` heading.", h5);
105el!("The `<h6>` heading (least important).", h6);
106el!("The `<hgroup>` groups heading + subheading.", hgroup);
107el!("The `<main>` element — dominant body content.", main);
108el!("The `<nav>` element — navigation links.", nav);
109el!("The `<section>` element — standalone section.", section);
110el!("The `<search>` element — search/filter area.", search);
111
112el!("The `<blockquote>` element — extended quotation.", blockquote, { "Source URL." cite });
117el!("The `<dd>` element — description of a term.", dd);
118el!("The `<div>` element — generic flow container.", div);
119el!("The `<dl>` element — description list.", dl);
120el!("The `<dt>` element — term in description list.", dt);
121el!("The `<figcaption>` — caption for a figure.", figcaption);
122el!("The `<figure>` — self-contained content + caption.", figure);
123el!("The `<hr>` element — thematic break.", hr);
124el!("The `<li>` element — list item.", li, { "Ordinal value." value });
125el!("The `<menu>` element — unordered command list.", menu);
126el!("The `<ol>` element — ordered list.", ol, { "Reverse order." reversed, "Start number." start, "Numbering type." r#type });
127el!("The `<p>` element — paragraph.", p);
128el!("The `<pre>` element — preformatted text.", pre);
129el!("The `<ul>` element — unordered list.", ul);
130
131el!("The `<a>` element — hyperlink.", a, { "Link URL." href, "Browsing context." target, "Relationship." rel, "Download hint." download });
136el!("The `<abbr>` element — abbreviation.", abbr);
137el!("The `<b>` element — bold text.", b);
138el!("The `<bdi>` element — bidirectional isolation.", bdi);
139el!("The `<bdo>` element — bidirectional override.", bdo);
140el!("The `<br>` element — line break.", br);
141el!("The `<cite>` element — creative work title.", cite);
142el!("The `<code>` element — inline code.", code);
143el!("The `<data>` element — machine-readable value.", data, { "Machine-readable value." value });
144el!("The `<dfn>` element — defining instance.", dfn);
145el!("The `<em>` element — stress emphasis.", em);
146el!("The `<i>` element — alternate voice (italic).", i);
147el!("The `<kbd>` element — keyboard input.", kbd);
148el!("The `<mark>` element — highlighted text.", mark);
149el!("The `<q>` element — inline quotation.", q, { "Source URL." cite });
150el!("The `<rp>` element — ruby fallback.", rp);
151el!("The `<rt>` element — ruby text.", rt);
152el!("The `<ruby>` element — ruby annotation.", ruby);
153el!("The `<s>` element — strikethrough.", s);
154el!("The `<samp>` element — sample output.", samp);
155el!("The `<small>` element — side comment.", small);
156el!("The `<span>` element — generic inline container.", span);
157el!("The `<strong>` element — strong importance.", strong);
158el!("The `<sub>` element — subscript.", sub);
159el!("The `<sup>` element — superscript.", sup);
160el!("The `<time>` element — date/time.", time, { "Machine-readable datetime." datetime });
161el!("The `<u>` element — underline.", u);
162el!("The `<var>` element — variable name.", var);
163el!("The `<wbr>` element — word break opportunity.", wbr);
164
165el!("The `<area>` element — image map region.", area);
170el!("The `<audio>` element — sound content.", audio, { "Audio URL." src, "Auto-play." autoplay, "Show controls." controls, "Loop playback." r#loop, "Mute audio." muted, "Preload hint." preload });
171el!("The `<img>` element — embedded image.", img, { "Image URL." src, "Alt text." alt, "Width." width, "Height." height, "Lazy loading." loading, "Decode timing." decoding, "CORS mode." crossorigin, "Responsive sources." srcset, "Responsive sizes." sizes });
172el!("The `<map>` element — image map.", map);
173el!("The `<track>` element — media text track.", track, { "Track URL." src, "Track kind." kind, "Track language." srclang, "Track label." label });
174el!("The `<video>` element — video content.", video, { "Video URL." src, "Auto-play." autoplay, "Show controls." controls, "Loop playback." r#loop, "Mute audio." muted, "Preview image." poster, "Preload hint." preload, "Width." width, "Height." height });
175
176el!("The `<embed>` element — external content.", embed, { "Resource URL." src, "MIME type." r#type, "Width." width, "Height." height });
181el!("The `<iframe>` element — nested page.", iframe, { "Page URL." src, "Inline HTML." srcdoc, "Context name." name, "Sandbox restrictions." sandbox, "Permissions policy." allow, "Width." width, "Height." height, "Lazy loading." loading });
182el!("The `<object>` element — external resource.", object);
183el!("The `<picture>` element — responsive images.", picture);
184el!("The `<portal>` element — page transitions.", portal);
185el!("The `<source>` element — media resource.", source, { "Resource URL." src, "MIME type." r#type, "Responsive sources." srcset, "Responsive sizes." sizes, "Media query." media });
186
187el!("The `<svg>` element — SVG container.", svg, { "SVG viewport." viewBox, "XML namespace." xmlns, "Fill paint." fill, "Stroke paint." stroke, "Width." width, "Height." height });
192el!("The `<math>` element — MathML container.", math);
193
194el!("The `<canvas>` element — drawing surface.", canvas, { "Width." width, "Height." height });
199el!("The `<noscript>` element — no-JS fallback.", noscript);
200el!("The `<script>` element — executable code.", script, { "Script URL." src, "Script type." r#type, "Defer execution." defer, "Async execution." r#async, "CORS mode." crossorigin, "SRI hash." integrity });
201
202el!("The `<del>` element — deleted text.", del, { "Source URL." cite, "Datetime." datetime });
207el!("The `<ins>` element — inserted text.", ins, { "Source URL." cite, "Datetime." datetime });
208
209el!("The `<caption>` element — table caption.", caption);
214el!("The `<col>` element — table column.", col, { "Column span." span });
215el!("The `<colgroup>` element — column group.", colgroup, { "Column span." span });
216el!("The `<table>` element — tabular data.", table);
217el!("The `<tbody>` element — table body.", tbody);
218el!("The `<td>` element — table data cell.", td, { "Columns to span." colspan, "Rows to span." rowspan, "Related headers." headers });
219el!("The `<tfoot>` element — table footer.", tfoot);
220el!("The `<th>` element — table header cell.", th, { "Columns to span." colspan, "Rows to span." rowspan, "Header scope." scope, "Related headers." headers });
221el!("The `<thead>` element — table header.", thead);
222el!("The `<tr>` element — table row.", tr);
223
224el!("The `<button>` element — clickable button.", button, { "Button type." r#type, "Disabled." disabled, "Form name." name, "Submission value." value, "Associated form." form });
229el!("The `<datalist>` element — input suggestions.", datalist);
230el!("The `<fieldset>` element — control group.", fieldset, { "Disabled." disabled, "Associated form." form, "Name." name });
231el!("The `<form>` element — submission controls.", form, { "Submission URL." action, "HTTP method." method, "Encoding type." enctype, "Skip validation." novalidate, "Target context." target, "Auto-fill." autocomplete, "Form name." name });
232el!("The `<input>` element — form control.", input, { "Input type." r#type, "Name." name, "Value." value, "Placeholder." placeholder, "Required." required, "Disabled." disabled, "Read-only." readonly, "Pre-checked." checked, "Allow multiple." multiple, "Max length." maxlength, "Min length." minlength, "Minimum." min, "Maximum." max, "Step interval." step, "Validation pattern." pattern, "Auto-fill." autocomplete, "Auto-focus." autofocus, "Associated form." form, "Datalist reference." list, "Accepted file types." accept, "Image URL." src, "Image alt." alt });
233el!("The `<label>` element — form control caption.", label, { "Labeled control." r#for });
234el!("The `<legend>` element — fieldset caption.", legend);
235el!("The `<meter>` element — scalar measurement.", meter, { "Current value." value, "Minimum." min, "Maximum." max, "Low threshold." low, "High threshold." high, "Optimum value." optimum });
236el!("The `<optgroup>` element — option group.", optgroup, { "Group label." label, "Disabled." disabled });
237el!("The `<option>` element — select item.", option, { "Submission value." value, "Pre-selected." selected, "Disabled." disabled, "Display text." label });
238el!("The `<output>` element — calculation result.", output, { "Related controls." r#for, "Associated form." form, "Name." name });
239el!("The `<progress>` element — task progress.", progress, { "Current progress." value, "Total." max });
240el!("The `<select>` element — drop-down list.", select, { "Name." name, "Allow multi-select." multiple, "Required." required, "Disabled." disabled, "Visible options." size, "Associated form." form });
241el!("The `<textarea>` element — multi-line input.", textarea, { "Name." name, "Visible rows." rows, "Visible columns." cols, "Placeholder." placeholder, "Required." required, "Disabled." disabled, "Read-only." readonly, "Max length." maxlength, "Min length." minlength, "Text wrapping." wrap, "Auto-fill." autocomplete, "Auto-focus." autofocus, "Associated form." form });
242
243el!("The `<details>` element — disclosure widget.", details, { "Initially open." open });
248el!("The `<dialog>` element — dialog box.", dialog, { "Visible." open });
249el!("The `<summary>` element — details heading.", summary);
250
251el!("The `<slot>` element — web component placeholder.", slot, { "Slot name." name });
256el!("The `<template>` element — inert HTML template.", template);
257
258el!("SVG `<path>` — shape via draw commands.", path, { "Path data." d, "Fill paint." fill, "Stroke paint." stroke, "Stroke width." stroke_width, "Fill rule." fill_rule, "Clip rule." clip_rule, "Transform." transform });
263el!("SVG `<circle>` — circle shape.", circle, { "Center X." cx, "Center Y." cy, "Radius." r, "Fill." fill, "Stroke." stroke, "Stroke width." stroke_width });
264el!("SVG `<rect>` — rectangle.", rect, { "X position." x, "Y position." y, "Width." width, "Height." height, "Corner radius X." rx, "Corner radius Y." ry, "Fill." fill, "Stroke." stroke });
265el!("SVG `<line>` — straight line.", line, { "Start X." x1, "Start Y." y1, "End X." x2, "End Y." y2, "Stroke." stroke, "Stroke width." stroke_width });
266el!("SVG `<polyline>` — connected segments.", polyline, { "Points." points, "Fill." fill, "Stroke." stroke });
267el!("SVG `<polygon>` — closed polygon.", polygon, { "Points." points, "Fill." fill, "Stroke." stroke });
268el!("SVG `<ellipse>` — ellipse shape.", ellipse, { "Center X." cx, "Center Y." cy, "Radius X." rx, "Radius Y." ry, "Fill." fill, "Stroke." stroke });
269el!("SVG `<text>` — text rendering.", text, { "X position." x, "Y position." y, "Fill." fill });
270el!("SVG `<g>` — group container.", g, { "Transform." transform, "Fill." fill, "Stroke." stroke });
271el!("SVG `<defs>` — reusable definitions.", defs);
272el!("SVG `<use>` — reuse referenced element.", r#use, { "Reference URL." href, "X position." x, "Y position." y, "Width." width, "Height." height });
273el!("SVG `<clipPath>` — clipping region.", clipPath);
274el!("SVG `<mask>` — alpha mask.", mask);
275el!("SVG `<pattern>` — fill pattern.", pattern);
276el!("SVG `<linearGradient>` — linear gradient.", linearGradient, { "Start X." x1, "Start Y." y1, "End X." x2, "End Y." y2 });
277el!("SVG `<radialGradient>` — radial gradient.", radialGradient, { "Center X." cx, "Center Y." cy, "Radius." r, "Focus X." fx, "Focus Y." fy });
278el!("SVG `<stop>` — gradient color stop.", stop);
279el!("SVG `<filter>` — filter effect.", filter);
280el!("SVG `<image>` — embedded image in SVG.", image, { "Image URL." href, "X position." x, "Y position." y, "Width." width, "Height." height });
281el!("SVG `<symbol>` — reusable graphic template.", symbol, { "SVG viewport." viewBox });
282el!("SVG `<animate>` — attribute animation.", animate);
283el!(
284 "SVG `<animateTransform>` — transform animation.",
285 animateTransform
286);
287el!("SVG `<foreignObject>` — foreign XML (HTML) in SVG.", foreignObject, { "X position." x, "Y position." y, "Width." width, "Height." height });
288el!("SVG `<tspan>` — text subspan.", tspan, { "X position." x, "Y position." y });