Coverage for src/minihtml/tags.py: 100%

118 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-04-06 18:07 +0200

1from minihtml import PrototypeEmpty, PrototypeNonEmpty, make_prototype 

2 

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] 

128 

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.outl(f"#: The ``{tag}`` element.") 

140# cog.out(f'{name}: {type} = make_prototype("{tag}"') 

141# if info.get("inline", False): 

142# cog.out(", inline=True") 

143# if info.get("empty", False): 

144# cog.out(", empty=True") 

145# if info.get("omit_end_tag", False): 

146# cog.out(", omit_end_tag=True") 

147# cog.out(")\n") 

148# if alias: 

149# cog.outl(f"#: The ``{tag}`` element. Alias for :data:`{name}`.") 

150# cog.outl(f"{alias} = {name}") 

151# 

152# ]]] 

153#: The ``html`` element. 

154html: PrototypeNonEmpty = make_prototype("html") 

155#: The ``head`` element. 

156head: PrototypeNonEmpty = make_prototype("head") 

157#: The ``title`` element. 

158title: PrototypeNonEmpty = make_prototype("title") 

159#: The ``base`` element. 

160base: PrototypeEmpty = make_prototype("base", empty=True, omit_end_tag=True) 

161#: The ``link`` element. 

162link: PrototypeEmpty = make_prototype("link", empty=True, omit_end_tag=True) 

163#: The ``meta`` element. 

164meta: PrototypeEmpty = make_prototype("meta", empty=True, omit_end_tag=True) 

165#: The ``style`` element. 

166style: PrototypeNonEmpty = make_prototype("style") 

167#: The ``body`` element. 

168body: PrototypeNonEmpty = make_prototype("body") 

169#: The ``article`` element. 

170article: PrototypeNonEmpty = make_prototype("article") 

171#: The ``section`` element. 

172section: PrototypeNonEmpty = make_prototype("section") 

173#: The ``nav`` element. 

174nav: PrototypeNonEmpty = make_prototype("nav") 

175#: The ``aside`` element. 

176aside: PrototypeNonEmpty = make_prototype("aside") 

177#: The ``h1`` element. 

178h1: PrototypeNonEmpty = make_prototype("h1") 

179#: The ``h2`` element. 

180h2: PrototypeNonEmpty = make_prototype("h2") 

181#: The ``h3`` element. 

182h3: PrototypeNonEmpty = make_prototype("h3") 

183#: The ``h4`` element. 

184h4: PrototypeNonEmpty = make_prototype("h4") 

185#: The ``h5`` element. 

186h5: PrototypeNonEmpty = make_prototype("h5") 

187#: The ``h6`` element. 

188h6: PrototypeNonEmpty = make_prototype("h6") 

189#: The ``hgroup`` element. 

190hgroup: PrototypeNonEmpty = make_prototype("hgroup") 

191#: The ``header`` element. 

192header: PrototypeNonEmpty = make_prototype("header") 

193#: The ``footer`` element. 

194footer: PrototypeNonEmpty = make_prototype("footer") 

195#: The ``address`` element. 

196address: PrototypeNonEmpty = make_prototype("address") 

197#: The ``p`` element. 

198p: PrototypeNonEmpty = make_prototype("p") 

199#: The ``hr`` element. 

200hr: PrototypeEmpty = make_prototype("hr", empty=True, omit_end_tag=True) 

201#: The ``pre`` element. 

202pre: PrototypeNonEmpty = make_prototype("pre") 

203#: The ``blockquote`` element. 

204blockquote: PrototypeNonEmpty = make_prototype("blockquote") 

205#: The ``ol`` element. 

206ol: PrototypeNonEmpty = make_prototype("ol") 

207#: The ``ul`` element. 

208ul: PrototypeNonEmpty = make_prototype("ul") 

209#: The ``menu`` element. 

210menu: PrototypeNonEmpty = make_prototype("menu") 

211#: The ``li`` element. 

212li: PrototypeNonEmpty = make_prototype("li") 

213#: The ``dl`` element. 

214dl: PrototypeNonEmpty = make_prototype("dl") 

215#: The ``dt`` element. 

216dt: PrototypeNonEmpty = make_prototype("dt") 

217#: The ``dd`` element. 

218dd: PrototypeNonEmpty = make_prototype("dd") 

219#: The ``figure`` element. 

220figure: PrototypeNonEmpty = make_prototype("figure") 

221#: The ``figcaption`` element. 

222figcaption: PrototypeNonEmpty = make_prototype("figcaption") 

223#: The ``main`` element. 

224main: PrototypeNonEmpty = make_prototype("main") 

225#: The ``search`` element. 

226search: PrototypeNonEmpty = make_prototype("search") 

227#: The ``div`` element. 

228div: PrototypeNonEmpty = make_prototype("div") 

229#: The ``a`` element. 

230a: PrototypeNonEmpty = make_prototype("a", inline=True) 

231#: The ``em`` element. 

232em: PrototypeNonEmpty = make_prototype("em", inline=True) 

233#: The ``strong`` element. 

234strong: PrototypeNonEmpty = make_prototype("strong", inline=True) 

235#: The ``small`` element. 

236small: PrototypeNonEmpty = make_prototype("small", inline=True) 

237#: The ``s`` element. 

238s: PrototypeNonEmpty = make_prototype("s", inline=True) 

239#: The ``cite`` element. 

240cite: PrototypeNonEmpty = make_prototype("cite", inline=True) 

241#: The ``q`` element. 

242q: PrototypeNonEmpty = make_prototype("q", inline=True) 

243#: The ``dfn`` element. 

244dfn: PrototypeNonEmpty = make_prototype("dfn", inline=True) 

245#: The ``abbr`` element. 

246abbr: PrototypeNonEmpty = make_prototype("abbr", inline=True) 

247#: The ``ruby`` element. 

248ruby: PrototypeNonEmpty = make_prototype("ruby", inline=True) 

249#: The ``rt`` element. 

250rt: PrototypeNonEmpty = make_prototype("rt", inline=True) 

251#: The ``rp`` element. 

252rp: PrototypeNonEmpty = make_prototype("rp", inline=True) 

253#: The ``data`` element. 

254data: PrototypeNonEmpty = make_prototype("data", inline=True) 

255#: The ``time`` element. 

256time: PrototypeNonEmpty = make_prototype("time", inline=True) 

257#: The ``code`` element. 

258code: PrototypeNonEmpty = make_prototype("code", inline=True) 

259#: The ``var`` element. 

260var: PrototypeNonEmpty = make_prototype("var", inline=True) 

261#: The ``samp`` element. 

262samp: PrototypeNonEmpty = make_prototype("samp", inline=True) 

263#: The ``kbd`` element. 

264kbd: PrototypeNonEmpty = make_prototype("kbd", inline=True) 

265#: The ``sub`` element. 

266sub: PrototypeNonEmpty = make_prototype("sub", inline=True) 

267#: The ``sup`` element. 

268sup: PrototypeNonEmpty = make_prototype("sup", inline=True) 

269#: The ``i`` element. 

270i: PrototypeNonEmpty = make_prototype("i", inline=True) 

271#: The ``b`` element. 

272b: PrototypeNonEmpty = make_prototype("b", inline=True) 

273#: The ``u`` element. 

274u: PrototypeNonEmpty = make_prototype("u", inline=True) 

275#: The ``mark`` element. 

276mark: PrototypeNonEmpty = make_prototype("mark", inline=True) 

277#: The ``bdi`` element. 

278bdi: PrototypeNonEmpty = make_prototype("bdi", inline=True) 

279#: The ``bdo`` element. 

280bdo: PrototypeNonEmpty = make_prototype("bdo", inline=True) 

281#: The ``span`` element. 

282span: PrototypeNonEmpty = make_prototype("span", inline=True) 

283#: The ``br`` element. 

284br: PrototypeEmpty = make_prototype("br", inline=True, empty=True, omit_end_tag=True) 

285#: The ``wbr`` element. 

286wbr: PrototypeEmpty = make_prototype("wbr", inline=True, empty=True, omit_end_tag=True) 

287#: The ``ins`` element. 

288ins: PrototypeNonEmpty = make_prototype("ins", inline=True) 

289#: The ``del`` element. 

290del_: PrototypeNonEmpty = make_prototype("del", inline=True) 

291#: The ``picture`` element. 

292picture: PrototypeNonEmpty = make_prototype("picture") 

293#: The ``source`` element. 

294source: PrototypeEmpty = make_prototype("source", empty=True, omit_end_tag=True) 

295#: The ``img`` element. 

296img: PrototypeEmpty = make_prototype("img", inline=True, empty=True, omit_end_tag=True) 

297#: The ``iframe`` element. 

298iframe: PrototypeEmpty = make_prototype("iframe", empty=True) 

299#: The ``embed`` element. 

300embed: PrototypeEmpty = make_prototype("embed", empty=True, omit_end_tag=True) 

301#: The ``object`` element. 

302object: PrototypeNonEmpty = make_prototype("object") 

303#: The ``object`` element. Alias for :data:`object`. 

304object_ = object 

305#: The ``video`` element. 

306video: PrototypeNonEmpty = make_prototype("video") 

307#: The ``audio`` element. 

308audio: PrototypeNonEmpty = make_prototype("audio") 

309#: The ``track`` element. 

310track: PrototypeEmpty = make_prototype("track", empty=True, omit_end_tag=True) 

311#: The ``map`` element. 

312map: PrototypeNonEmpty = make_prototype("map") 

313#: The ``map`` element. Alias for :data:`map`. 

314map_ = map 

315#: The ``area`` element. 

316area: PrototypeEmpty = make_prototype("area", empty=True, omit_end_tag=True) 

317#: The ``table`` element. 

318table: PrototypeNonEmpty = make_prototype("table") 

319#: The ``caption`` element. 

320caption: PrototypeNonEmpty = make_prototype("caption") 

321#: The ``colgroup`` element. 

322colgroup: PrototypeNonEmpty = make_prototype("colgroup") 

323#: The ``col`` element. 

324col: PrototypeEmpty = make_prototype("col", empty=True, omit_end_tag=True) 

325#: The ``tbody`` element. 

326tbody: PrototypeNonEmpty = make_prototype("tbody") 

327#: The ``thead`` element. 

328thead: PrototypeNonEmpty = make_prototype("thead") 

329#: The ``tfoot`` element. 

330tfoot: PrototypeNonEmpty = make_prototype("tfoot") 

331#: The ``tr`` element. 

332tr: PrototypeNonEmpty = make_prototype("tr") 

333#: The ``td`` element. 

334td: PrototypeNonEmpty = make_prototype("td") 

335#: The ``th`` element. 

336th: PrototypeNonEmpty = make_prototype("th") 

337#: The ``form`` element. 

338form: PrototypeNonEmpty = make_prototype("form") 

339#: The ``label`` element. 

340label: PrototypeNonEmpty = make_prototype("label") 

341#: The ``input`` element. 

342input: PrototypeEmpty = make_prototype("input", empty=True, omit_end_tag=True) 

343#: The ``input`` element. Alias for :data:`input`. 

344input_ = input 

345#: The ``button`` element. 

346button: PrototypeNonEmpty = make_prototype("button") 

347#: The ``select`` element. 

348select: PrototypeNonEmpty = make_prototype("select") 

349#: The ``datalist`` element. 

350datalist: PrototypeNonEmpty = make_prototype("datalist") 

351#: The ``optgroup`` element. 

352optgroup: PrototypeNonEmpty = make_prototype("optgroup") 

353#: The ``option`` element. 

354option: PrototypeNonEmpty = make_prototype("option") 

355#: The ``textarea`` element. 

356textarea: PrototypeNonEmpty = make_prototype("textarea") 

357#: The ``output`` element. 

358output: PrototypeNonEmpty = make_prototype("output") 

359#: The ``progress`` element. 

360progress: PrototypeNonEmpty = make_prototype("progress") 

361#: The ``meter`` element. 

362meter: PrototypeNonEmpty = make_prototype("meter") 

363#: The ``fieldset`` element. 

364fieldset: PrototypeNonEmpty = make_prototype("fieldset") 

365#: The ``legend`` element. 

366legend: PrototypeNonEmpty = make_prototype("legend") 

367#: The ``details`` element. 

368details: PrototypeNonEmpty = make_prototype("details") 

369#: The ``summary`` element. 

370summary: PrototypeNonEmpty = make_prototype("summary") 

371#: The ``dialog`` element. 

372dialog: PrototypeNonEmpty = make_prototype("dialog") 

373#: The ``script`` element. 

374script: PrototypeNonEmpty = make_prototype("script") 

375#: The ``noscript`` element. 

376noscript: PrototypeNonEmpty = make_prototype("noscript") 

377#: The ``template`` element. 

378template: PrototypeNonEmpty = make_prototype("template") 

379#: The ``template`` element. Alias for :data:`template`. 

380template_ = template 

381#: The ``slot`` element. 

382slot: PrototypeNonEmpty = make_prototype("slot") 

383#: The ``canvas`` element. 

384canvas: PrototypeNonEmpty = make_prototype("canvas") 

385# [[[end]]] (checksum: 9d0f6f3a6fdd91db8b23518117d3e1e2)