Coverage for src/minihtml/tags.py: 100%
118 statements
« prev ^ index » next coverage.py v7.6.12, created at 2025-02-22 21:44 +0100
« prev ^ index » next coverage.py v7.6.12, created at 2025-02-22 21:44 +0100
1from minihtml import PrototypeEmpty, PrototypeNonEmpty, make_prototype
3__all__ = [
4 # [[[cog
5 # from yaml import safe_load
6 #
7 # with open(TAGS) as f:
8 # SPEC = safe_load(f)
9 #
10 # for tag in SPEC["tags"]:
11 # info = SPEC["tags"][tag] or {}
12 # cog.outl(f'"{info.get("alias", tag)}",')
13 # ]]]
14 "html",
15 "head",
16 "title",
17 "base",
18 "link",
19 "meta",
20 "style",
21 "body",
22 "article",
23 "section",
24 "nav",
25 "aside",
26 "h1",
27 "h2",
28 "h3",
29 "h4",
30 "h5",
31 "h6",
32 "hgroup",
33 "header",
34 "footer",
35 "address",
36 "p",
37 "hr",
38 "pre",
39 "blockquote",
40 "ol",
41 "ul",
42 "menu",
43 "li",
44 "dl",
45 "dt",
46 "dd",
47 "figure",
48 "figcaption",
49 "main",
50 "search",
51 "div",
52 "a",
53 "em",
54 "strong",
55 "small",
56 "s",
57 "cite",
58 "q",
59 "dfn",
60 "abbr",
61 "ruby",
62 "rt",
63 "rp",
64 "data",
65 "time",
66 "code",
67 "var",
68 "samp",
69 "kbd",
70 "sub",
71 "sup",
72 "i",
73 "b",
74 "u",
75 "mark",
76 "bdi",
77 "bdo",
78 "span",
79 "br",
80 "wbr",
81 "ins",
82 "del_",
83 "picture",
84 "source",
85 "img",
86 "iframe",
87 "embed",
88 "object_",
89 "video",
90 "audio",
91 "track",
92 "map_",
93 "area",
94 "table",
95 "caption",
96 "colgroup",
97 "col",
98 "tbody",
99 "thead",
100 "tfoot",
101 "tr",
102 "td",
103 "th",
104 "form",
105 "label",
106 "input_",
107 "button",
108 "select",
109 "datalist",
110 "optgroup",
111 "option",
112 "textarea",
113 "output",
114 "progress",
115 "meter",
116 "fieldset",
117 "legend",
118 "details",
119 "summary",
120 "dialog",
121 "script",
122 "noscript",
123 "template_",
124 "slot",
125 "canvas",
126 # [[[end]]] (checksum: 8f9d1678585a7aed604675580615b43b)
127]
129# [[[cog
130# for tag in SPEC["tags"]:
131# info = SPEC["tags"][tag] or {}
132# if info.get("hidden"):
133# name, alias = info["alias"], None
134# else:
135# name, alias = tag, info.get("alias")
136#
137# type = "PrototypeEmpty" if info.get("empty", False) else "PrototypeNonEmpty"
138#
139# cog.out(f'{name}: {type} = make_prototype("{tag}"')
140# if info.get("inline", False):
141# cog.out(", inline=True")
142# if info.get("empty", False):
143# cog.out(", empty=True")
144# if info.get("omit_end_tag", False):
145# cog.out(", omit_end_tag=True")
146# cog.out(")\n")
147# if alias:
148# cog.outl(f"{alias} = {name}")
149#
150# ]]]
151html: PrototypeNonEmpty = make_prototype("html")
152head: PrototypeNonEmpty = make_prototype("head")
153title: PrototypeNonEmpty = make_prototype("title")
154base: PrototypeEmpty = make_prototype("base", empty=True, omit_end_tag=True)
155link: PrototypeEmpty = make_prototype("link", empty=True, omit_end_tag=True)
156meta: PrototypeEmpty = make_prototype("meta", empty=True, omit_end_tag=True)
157style: PrototypeNonEmpty = make_prototype("style")
158body: PrototypeNonEmpty = make_prototype("body")
159article: PrototypeNonEmpty = make_prototype("article")
160section: PrototypeNonEmpty = make_prototype("section")
161nav: PrototypeNonEmpty = make_prototype("nav")
162aside: PrototypeNonEmpty = make_prototype("aside")
163h1: PrototypeNonEmpty = make_prototype("h1")
164h2: PrototypeNonEmpty = make_prototype("h2")
165h3: PrototypeNonEmpty = make_prototype("h3")
166h4: PrototypeNonEmpty = make_prototype("h4")
167h5: PrototypeNonEmpty = make_prototype("h5")
168h6: PrototypeNonEmpty = make_prototype("h6")
169hgroup: PrototypeNonEmpty = make_prototype("hgroup")
170header: PrototypeNonEmpty = make_prototype("header")
171footer: PrototypeNonEmpty = make_prototype("footer")
172address: PrototypeNonEmpty = make_prototype("address")
173p: PrototypeNonEmpty = make_prototype("p")
174hr: PrototypeEmpty = make_prototype("hr", empty=True, omit_end_tag=True)
175pre: PrototypeNonEmpty = make_prototype("pre")
176blockquote: PrototypeNonEmpty = make_prototype("blockquote")
177ol: PrototypeNonEmpty = make_prototype("ol")
178ul: PrototypeNonEmpty = make_prototype("ul")
179menu: PrototypeNonEmpty = make_prototype("menu")
180li: PrototypeNonEmpty = make_prototype("li")
181dl: PrototypeNonEmpty = make_prototype("dl")
182dt: PrototypeNonEmpty = make_prototype("dt")
183dd: PrototypeNonEmpty = make_prototype("dd")
184figure: PrototypeNonEmpty = make_prototype("figure")
185figcaption: PrototypeNonEmpty = make_prototype("figcaption")
186main: PrototypeNonEmpty = make_prototype("main")
187search: PrototypeNonEmpty = make_prototype("search")
188div: PrototypeNonEmpty = make_prototype("div")
189a: PrototypeNonEmpty = make_prototype("a", inline=True)
190em: PrototypeNonEmpty = make_prototype("em", inline=True)
191strong: PrototypeNonEmpty = make_prototype("strong", inline=True)
192small: PrototypeNonEmpty = make_prototype("small", inline=True)
193s: PrototypeNonEmpty = make_prototype("s", inline=True)
194cite: PrototypeNonEmpty = make_prototype("cite", inline=True)
195q: PrototypeNonEmpty = make_prototype("q", inline=True)
196dfn: PrototypeNonEmpty = make_prototype("dfn", inline=True)
197abbr: PrototypeNonEmpty = make_prototype("abbr", inline=True)
198ruby: PrototypeNonEmpty = make_prototype("ruby", inline=True)
199rt: PrototypeNonEmpty = make_prototype("rt", inline=True)
200rp: PrototypeNonEmpty = make_prototype("rp", inline=True)
201data: PrototypeNonEmpty = make_prototype("data", inline=True)
202time: PrototypeNonEmpty = make_prototype("time", inline=True)
203code: PrototypeNonEmpty = make_prototype("code", inline=True)
204var: PrototypeNonEmpty = make_prototype("var", inline=True)
205samp: PrototypeNonEmpty = make_prototype("samp", inline=True)
206kbd: PrototypeNonEmpty = make_prototype("kbd", inline=True)
207sub: PrototypeNonEmpty = make_prototype("sub", inline=True)
208sup: PrototypeNonEmpty = make_prototype("sup", inline=True)
209i: PrototypeNonEmpty = make_prototype("i", inline=True)
210b: PrototypeNonEmpty = make_prototype("b", inline=True)
211u: PrototypeNonEmpty = make_prototype("u", inline=True)
212mark: PrototypeNonEmpty = make_prototype("mark", inline=True)
213bdi: PrototypeNonEmpty = make_prototype("bdi", inline=True)
214bdo: PrototypeNonEmpty = make_prototype("bdo", inline=True)
215span: PrototypeNonEmpty = make_prototype("span", inline=True)
216br: PrototypeEmpty = make_prototype("br", inline=True, empty=True, omit_end_tag=True)
217wbr: PrototypeEmpty = make_prototype("wbr", inline=True, empty=True, omit_end_tag=True)
218ins: PrototypeNonEmpty = make_prototype("ins", inline=True)
219del_: PrototypeNonEmpty = make_prototype("del", inline=True)
220picture: PrototypeNonEmpty = make_prototype("picture")
221source: PrototypeEmpty = make_prototype("source", empty=True, omit_end_tag=True)
222img: PrototypeEmpty = make_prototype("img", inline=True, empty=True, omit_end_tag=True)
223iframe: PrototypeEmpty = make_prototype("iframe", empty=True)
224embed: PrototypeEmpty = make_prototype("embed", empty=True, omit_end_tag=True)
225object: PrototypeNonEmpty = make_prototype("object")
226object_ = object
227video: PrototypeNonEmpty = make_prototype("video")
228audio: PrototypeNonEmpty = make_prototype("audio")
229track: PrototypeEmpty = make_prototype("track", empty=True, omit_end_tag=True)
230map: PrototypeNonEmpty = make_prototype("map")
231map_ = map
232area: PrototypeEmpty = make_prototype("area", empty=True, omit_end_tag=True)
233table: PrototypeNonEmpty = make_prototype("table")
234caption: PrototypeNonEmpty = make_prototype("caption")
235colgroup: PrototypeNonEmpty = make_prototype("colgroup")
236col: PrototypeEmpty = make_prototype("col", empty=True, omit_end_tag=True)
237tbody: PrototypeNonEmpty = make_prototype("tbody")
238thead: PrototypeNonEmpty = make_prototype("thead")
239tfoot: PrototypeNonEmpty = make_prototype("tfoot")
240tr: PrototypeNonEmpty = make_prototype("tr")
241td: PrototypeNonEmpty = make_prototype("td")
242th: PrototypeNonEmpty = make_prototype("th")
243form: PrototypeNonEmpty = make_prototype("form")
244label: PrototypeNonEmpty = make_prototype("label")
245input: PrototypeEmpty = make_prototype("input", empty=True, omit_end_tag=True)
246input_ = input
247button: PrototypeNonEmpty = make_prototype("button")
248select: PrototypeNonEmpty = make_prototype("select")
249datalist: PrototypeNonEmpty = make_prototype("datalist")
250optgroup: PrototypeNonEmpty = make_prototype("optgroup")
251option: PrototypeNonEmpty = make_prototype("option")
252textarea: PrototypeNonEmpty = make_prototype("textarea")
253output: PrototypeNonEmpty = make_prototype("output")
254progress: PrototypeNonEmpty = make_prototype("progress")
255meter: PrototypeNonEmpty = make_prototype("meter")
256fieldset: PrototypeNonEmpty = make_prototype("fieldset")
257legend: PrototypeNonEmpty = make_prototype("legend")
258details: PrototypeNonEmpty = make_prototype("details")
259summary: PrototypeNonEmpty = make_prototype("summary")
260dialog: PrototypeNonEmpty = make_prototype("dialog")
261script: PrototypeNonEmpty = make_prototype("script")
262noscript: PrototypeNonEmpty = make_prototype("noscript")
263template: PrototypeNonEmpty = make_prototype("template")
264template_ = template
265slot: PrototypeNonEmpty = make_prototype("slot")
266canvas: PrototypeNonEmpty = make_prototype("canvas")
267# [[[end]]] (checksum: b3b6a50dc8f4e349aca1295554ccf095)