1use crate::{Node, Void};
2use std::borrow::Cow;
3
4pub trait Html5 {
6 fn doctype(&mut self);
8
9 fn a(&mut self) -> Node;
11
12 fn abbr(&mut self) -> Node;
14
15 fn address(&mut self) -> Node;
17
18 fn area(&mut self) -> Void;
20
21 fn article(&mut self) -> Node;
23
24 fn aside(&mut self) -> Node;
26
27 fn audio(&mut self) -> Node;
29
30 fn b(&mut self) -> Node;
32
33 fn base(&mut self) -> Void;
35
36 fn bdi(&mut self) -> Node;
38
39 fn bdo(&mut self) -> Node;
41
42 fn blockquote(&mut self) -> Node;
44
45 fn body(&mut self) -> Node;
47
48 fn br(&mut self) -> Void;
50
51 fn button(&mut self) -> Node;
53
54 fn canvas(&mut self) -> Node;
56
57 fn caption(&mut self) -> Node;
59
60 fn cite(&mut self) -> Node;
62
63 fn code(&mut self) -> Node;
65
66 fn col(&mut self) -> Void;
68
69 fn colgroup(&mut self) -> Node;
71
72 fn data(&mut self) -> Node;
74
75 fn datalist(&mut self) -> Node;
77
78 fn dd(&mut self) -> Node;
80
81 fn del(&mut self) -> Node;
83
84 fn details(&mut self) -> Node;
86
87 fn dfn(&mut self) -> Node;
89
90 fn dialog(&mut self) -> Node;
92
93 fn div(&mut self) -> Node;
95
96 fn dl(&mut self) -> Node;
98
99 fn dt(&mut self) -> Node;
101
102 fn em(&mut self) -> Node;
104
105 fn embed(&mut self) -> Void;
107
108 fn fieldset(&mut self) -> Node;
110
111 fn figcaption(&mut self) -> Node;
113
114 fn figure(&mut self) -> Node;
116
117 fn footer(&mut self) -> Node;
119
120 fn form(&mut self) -> Node;
122
123 fn h1(&mut self) -> Node;
125
126 fn h2(&mut self) -> Node;
128
129 fn h3(&mut self) -> Node;
131
132 fn h4(&mut self) -> Node;
134
135 fn h5(&mut self) -> Node;
137
138 fn h6(&mut self) -> Node;
140
141 fn head(&mut self) -> Node;
143
144 fn header(&mut self) -> Node;
146
147 fn hr(&mut self) -> Void;
149
150 fn html(&mut self) -> Node;
152
153 fn i(&mut self) -> Node;
155
156 fn iframe(&mut self) -> Node;
158
159 fn img(&mut self) -> Void;
161
162 fn input(&mut self) -> Void;
164
165 fn ins(&mut self) -> Node;
167
168 fn kbd(&mut self) -> Node;
170
171 fn label(&mut self) -> Node;
173
174 fn legend(&mut self) -> Node;
176
177 fn li(&mut self) -> Node;
179
180 fn link(&mut self) -> Void;
182
183 fn main(&mut self) -> Node;
185
186 fn map(&mut self) -> Node;
188
189 fn mark(&mut self) -> Node;
191
192 fn meta(&mut self) -> Void;
194
195 fn meter(&mut self) -> Node;
197
198 fn nav(&mut self) -> Node;
200
201 fn noscript(&mut self) -> Node;
203
204 fn object(&mut self) -> Node;
206
207 fn ol(&mut self) -> Node;
209
210 fn optgroup(&mut self) -> Node;
212
213 fn option(&mut self) -> Node;
215
216 fn output(&mut self) -> Node;
218
219 fn p(&mut self) -> Node;
221
222 fn param(&mut self) -> Void;
224
225 fn picture(&mut self) -> Node;
227
228 fn pre(&mut self) -> Node;
230
231 fn progress(&mut self) -> Node;
233
234 fn q(&mut self) -> Node;
236
237 fn rp(&mut self) -> Node;
239
240 fn rt(&mut self) -> Node;
242
243 fn ruby(&mut self) -> Node;
245
246 fn s(&mut self) -> Node;
248
249 fn samp(&mut self) -> Node;
251
252 fn script(&mut self) -> Node;
254
255 fn section(&mut self) -> Node;
257
258 fn select(&mut self) -> Node;
260
261 fn small(&mut self) -> Node;
263
264 fn source(&mut self) -> Void;
266
267 fn span(&mut self) -> Node;
269
270 fn strong(&mut self) -> Node;
272
273 fn style(&mut self) -> Node;
275
276 fn sub(&mut self) -> Node;
278
279 fn summary(&mut self) -> Node;
281
282 fn sup(&mut self) -> Node;
284
285 fn svg(&mut self) -> Node;
287
288 fn table(&mut self) -> Node;
290
291 fn tbody(&mut self) -> Node;
293
294 fn td(&mut self) -> Node;
296
297 fn template(&mut self) -> Node;
299
300 fn textarea(&mut self) -> Node;
302
303 fn tfoot(&mut self) -> Node;
305
306 fn th(&mut self) -> Node;
308
309 fn thead(&mut self) -> Node;
311
312 fn time(&mut self) -> Node;
314
315 fn title(&mut self) -> Node;
317
318 fn tr(&mut self) -> Node;
320
321 fn track(&mut self) -> Void;
323
324 fn u(&mut self) -> Node;
326
327 fn ul(&mut self) -> Node;
329
330 fn var(&mut self) -> Node;
332
333 fn video(&mut self) -> Node;
335
336 fn wbr(&mut self) -> Void;
338}
339
340impl<'a> Html5 for Node<'a> {
341 fn doctype(&mut self) {
343 self.void_child(Cow::Borrowed("!DOCTYPE")).attr("html");
344 }
345
346 fn a(&mut self) -> Node {
348 self.child(Cow::Borrowed("a"))
349 }
350
351 fn abbr(&mut self) -> Node {
353 self.child(Cow::Borrowed("abbr"))
354 }
355
356 fn address(&mut self) -> Node {
358 self.child(Cow::Borrowed("address"))
359 }
360
361 fn area(&mut self) -> Void {
363 self.void_child(Cow::Borrowed("area"))
364 }
365
366 fn article(&mut self) -> Node {
368 self.child(Cow::Borrowed("article"))
369 }
370
371 fn aside(&mut self) -> Node {
373 self.child(Cow::Borrowed("aside"))
374 }
375
376 fn audio(&mut self) -> Node {
378 self.child(Cow::Borrowed("audio"))
379 }
380
381 fn b(&mut self) -> Node {
383 self.child(Cow::Borrowed("b"))
384 }
385
386 fn base(&mut self) -> Void {
388 self.void_child(Cow::Borrowed("base"))
389 }
390
391 fn bdi(&mut self) -> Node {
393 self.child(Cow::Borrowed("bdi"))
394 }
395
396 fn bdo(&mut self) -> Node {
398 self.child(Cow::Borrowed("bdo"))
399 }
400
401 fn blockquote(&mut self) -> Node {
403 self.child(Cow::Borrowed("blockquote"))
404 }
405
406 fn body(&mut self) -> Node {
408 self.child(Cow::Borrowed("body"))
409 }
410
411 fn br(&mut self) -> Void {
413 self.void_child(Cow::Borrowed("br"))
414 }
415
416 fn button(&mut self) -> Node {
418 self.child(Cow::Borrowed("button"))
419 }
420
421 fn canvas(&mut self) -> Node {
423 self.child(Cow::Borrowed("canvas"))
424 }
425
426 fn caption(&mut self) -> Node {
428 self.child(Cow::Borrowed("caption"))
429 }
430
431 fn cite(&mut self) -> Node {
433 self.child(Cow::Borrowed("cite"))
434 }
435
436 fn code(&mut self) -> Node {
438 self.child(Cow::Borrowed("code"))
439 }
440
441 fn col(&mut self) -> Void {
443 self.void_child(Cow::Borrowed("col"))
444 }
445
446 fn colgroup(&mut self) -> Node {
448 self.child(Cow::Borrowed("colgroup"))
449 }
450
451 fn data(&mut self) -> Node {
453 self.child(Cow::Borrowed("data"))
454 }
455
456 fn datalist(&mut self) -> Node {
458 self.child(Cow::Borrowed("datalist"))
459 }
460
461 fn dd(&mut self) -> Node {
463 self.child(Cow::Borrowed("dd"))
464 }
465
466 fn del(&mut self) -> Node {
468 self.child(Cow::Borrowed("del"))
469 }
470
471 fn details(&mut self) -> Node {
473 self.child(Cow::Borrowed("details"))
474 }
475
476 fn dfn(&mut self) -> Node {
478 self.child(Cow::Borrowed("dfn"))
479 }
480
481 fn dialog(&mut self) -> Node {
483 self.child(Cow::Borrowed("dialog"))
484 }
485
486 fn div(&mut self) -> Node {
488 self.child(Cow::Borrowed("div"))
489 }
490
491 fn dl(&mut self) -> Node {
493 self.child(Cow::Borrowed("dl"))
494 }
495
496 fn dt(&mut self) -> Node {
498 self.child(Cow::Borrowed("dt"))
499 }
500
501 fn em(&mut self) -> Node {
503 self.child(Cow::Borrowed("em"))
504 }
505
506 fn embed(&mut self) -> Void {
508 self.void_child(Cow::Borrowed("embed"))
509 }
510
511 fn fieldset(&mut self) -> Node {
513 self.child(Cow::Borrowed("fieldset"))
514 }
515
516 fn figcaption(&mut self) -> Node {
518 self.child(Cow::Borrowed("figcaption"))
519 }
520
521 fn figure(&mut self) -> Node {
523 self.child(Cow::Borrowed("figure"))
524 }
525
526 fn footer(&mut self) -> Node {
528 self.child(Cow::Borrowed("footer"))
529 }
530
531 fn form(&mut self) -> Node {
533 self.child(Cow::Borrowed("form"))
534 }
535
536 fn h1(&mut self) -> Node {
538 self.child(Cow::Borrowed("h1"))
539 }
540
541 fn h2(&mut self) -> Node {
543 self.child(Cow::Borrowed("h2"))
544 }
545
546 fn h3(&mut self) -> Node {
548 self.child(Cow::Borrowed("h3"))
549 }
550
551 fn h4(&mut self) -> Node {
553 self.child(Cow::Borrowed("h4"))
554 }
555
556 fn h5(&mut self) -> Node {
558 self.child(Cow::Borrowed("h5"))
559 }
560
561 fn h6(&mut self) -> Node {
563 self.child(Cow::Borrowed("h6"))
564 }
565
566 fn head(&mut self) -> Node {
568 self.child(Cow::Borrowed("head"))
569 }
570
571 fn header(&mut self) -> Node {
573 self.child(Cow::Borrowed("header"))
574 }
575
576 fn hr(&mut self) -> Void {
578 self.void_child(Cow::Borrowed("hr"))
579 }
580
581 fn html(&mut self) -> Node {
583 self.child(Cow::Borrowed("html"))
584 }
585
586 fn i(&mut self) -> Node {
588 self.child(Cow::Borrowed("i"))
589 }
590
591 fn iframe(&mut self) -> Node {
593 self.child(Cow::Borrowed("iframe"))
594 }
595
596 fn img(&mut self) -> Void {
598 self.void_child(Cow::Borrowed("img"))
599 }
600
601 fn input(&mut self) -> Void {
603 self.void_child(Cow::Borrowed("input"))
604 }
605
606 fn ins(&mut self) -> Node {
608 self.child(Cow::Borrowed("ins"))
609 }
610
611 fn kbd(&mut self) -> Node {
613 self.child(Cow::Borrowed("kbd"))
614 }
615
616 fn label(&mut self) -> Node {
618 self.child(Cow::Borrowed("label"))
619 }
620
621 fn legend(&mut self) -> Node {
623 self.child(Cow::Borrowed("legend"))
624 }
625
626 fn li(&mut self) -> Node {
628 self.child(Cow::Borrowed("li"))
629 }
630
631 fn link(&mut self) -> Void {
633 self.void_child(Cow::Borrowed("link"))
634 }
635
636 fn main(&mut self) -> Node {
638 self.child(Cow::Borrowed("main"))
639 }
640
641 fn map(&mut self) -> Node {
643 self.child(Cow::Borrowed("map"))
644 }
645
646 fn mark(&mut self) -> Node {
648 self.child(Cow::Borrowed("mark"))
649 }
650
651 fn meta(&mut self) -> Void {
653 self.void_child(Cow::Borrowed("meta"))
654 }
655
656 fn meter(&mut self) -> Node {
658 self.child(Cow::Borrowed("meter"))
659 }
660
661 fn nav(&mut self) -> Node {
663 self.child(Cow::Borrowed("nav"))
664 }
665
666 fn noscript(&mut self) -> Node {
668 self.child(Cow::Borrowed("noscript"))
669 }
670
671 fn object(&mut self) -> Node {
673 self.child(Cow::Borrowed("object"))
674 }
675
676 fn ol(&mut self) -> Node {
678 self.child(Cow::Borrowed("ol"))
679 }
680
681 fn optgroup(&mut self) -> Node {
683 self.child(Cow::Borrowed("optgroup"))
684 }
685
686 fn option(&mut self) -> Node {
688 self.child(Cow::Borrowed("option"))
689 }
690
691 fn output(&mut self) -> Node {
693 self.child(Cow::Borrowed("output"))
694 }
695
696 fn p(&mut self) -> Node {
698 self.child(Cow::Borrowed("p"))
699 }
700
701 fn param(&mut self) -> Void {
703 self.void_child(Cow::Borrowed("param"))
704 }
705
706 fn picture(&mut self) -> Node {
708 self.child(Cow::Borrowed("picture"))
709 }
710
711 fn pre(&mut self) -> Node {
713 self.child(Cow::Borrowed("pre"))
714 }
715
716 fn progress(&mut self) -> Node {
718 self.child(Cow::Borrowed("progress"))
719 }
720
721 fn q(&mut self) -> Node {
723 self.child(Cow::Borrowed("q"))
724 }
725
726 fn rp(&mut self) -> Node {
728 self.child(Cow::Borrowed("rp"))
729 }
730
731 fn rt(&mut self) -> Node {
733 self.child(Cow::Borrowed("rt"))
734 }
735
736 fn ruby(&mut self) -> Node {
738 self.child(Cow::Borrowed("ruby"))
739 }
740
741 fn s(&mut self) -> Node {
743 self.child(Cow::Borrowed("s"))
744 }
745
746 fn samp(&mut self) -> Node {
748 self.child(Cow::Borrowed("samp"))
749 }
750
751 fn script(&mut self) -> Node {
753 self.child(Cow::Borrowed("script"))
754 }
755
756 fn section(&mut self) -> Node {
758 self.child(Cow::Borrowed("section"))
759 }
760
761 fn select(&mut self) -> Node {
763 self.child(Cow::Borrowed("select"))
764 }
765
766 fn small(&mut self) -> Node {
768 self.child(Cow::Borrowed("small"))
769 }
770
771 fn source(&mut self) -> Void {
773 self.void_child(Cow::Borrowed("source"))
774 }
775
776 fn span(&mut self) -> Node {
778 self.child(Cow::Borrowed("span"))
779 }
780
781 fn strong(&mut self) -> Node {
783 self.child(Cow::Borrowed("strong"))
784 }
785
786 fn style(&mut self) -> Node {
788 self.child(Cow::Borrowed("style"))
789 }
790
791 fn sub(&mut self) -> Node {
793 self.child(Cow::Borrowed("sub"))
794 }
795
796 fn summary(&mut self) -> Node {
798 self.child(Cow::Borrowed("summary"))
799 }
800
801 fn sup(&mut self) -> Node {
803 self.child(Cow::Borrowed("sup"))
804 }
805
806 fn svg(&mut self) -> Node {
808 self.child(Cow::Borrowed("svg"))
809 }
810
811 fn table(&mut self) -> Node {
813 self.child(Cow::Borrowed("table"))
814 }
815
816 fn tbody(&mut self) -> Node {
818 self.child(Cow::Borrowed("tbody"))
819 }
820
821 fn td(&mut self) -> Node {
823 self.child(Cow::Borrowed("td"))
824 }
825
826 fn template(&mut self) -> Node {
828 self.child(Cow::Borrowed("template"))
829 }
830
831 fn textarea(&mut self) -> Node {
833 self.child(Cow::Borrowed("textarea"))
834 }
835
836 fn tfoot(&mut self) -> Node {
838 self.child(Cow::Borrowed("tfoot"))
839 }
840
841 fn th(&mut self) -> Node {
843 self.child(Cow::Borrowed("th"))
844 }
845
846 fn thead(&mut self) -> Node {
848 self.child(Cow::Borrowed("thead"))
849 }
850
851 fn time(&mut self) -> Node {
853 self.child(Cow::Borrowed("time"))
854 }
855
856 fn title(&mut self) -> Node {
858 self.child(Cow::Borrowed("title"))
859 }
860
861 fn tr(&mut self) -> Node {
863 self.child(Cow::Borrowed("tr"))
864 }
865
866 fn track(&mut self) -> Void {
868 self.void_child(Cow::Borrowed("track"))
869 }
870
871 fn u(&mut self) -> Node {
873 self.child(Cow::Borrowed("u"))
874 }
875
876 fn ul(&mut self) -> Node {
878 self.child(Cow::Borrowed("ul"))
879 }
880
881 fn var(&mut self) -> Node {
883 self.child(Cow::Borrowed("var"))
884 }
885
886 fn video(&mut self) -> Node {
888 self.child(Cow::Borrowed("video"))
889 }
890
891 fn wbr(&mut self) -> Void {
893 self.void_child(Cow::Borrowed("wbr"))
894 }
895}