The figure method (HTML5) is used for annotating illustrations, diagrams, photos, code listings, etc. You can use the tag to associate a caption together with some embedded content, such as a graphic or video. You can use the tag in conjunction with the figcapti
(self, **args)
| 1007 | self._closeTag('figure') |
| 1008 | |
| 1009 | def figcaption(self, **args): |
| 1010 | """The figure method (HTML5) is used for annotating illustrations, |
| 1011 | diagrams, photos, code listings, etc. You can use the tag to associate |
| 1012 | a caption together with some embedded content, such as a graphic or |
| 1013 | video. You can use the tag in conjunction with the |
| 1014 | <tag>figcaption</tag> element to provide a caption for the contents of |
| 1015 | your <tag>figure</tag> element. |
| 1016 | |
| 1017 | >>> b = HtmlBuilder() |
| 1018 | >>> b.compact = True |
| 1019 | >>> b.figure() |
| 1020 | >>> b.figcaption() |
| 1021 | >>> b.addHtml('Hello world') |
| 1022 | >>> b._figcaption() |
| 1023 | >>> b._figure() |
| 1024 | >>> b.getHtml() |
| 1025 | '<figure><figcaption>Hello world</figcaption></figure>' |
| 1026 | """ |
| 1027 | self.write_tag('figcaption', True, args) |
| 1028 | |
| 1029 | def _figcaption(self): |
| 1030 | self._closeTag('figcaption') |