A special <widget>-Tag could be used to identify the current html5.Widget-subclass.
class MyText(html5.Span):
def __init__(self):
super().__init__(
"""
<widget class="big" title="Hahaha">
Hello My Text
</widget>
"""
would result in
<span class="big" title="Hahaha">
Hello My Text
</span>
The special <widget>-Tag should only be allowed at top-level of the Template.