viur-framework / flare

Python framework to create web-apps on top of Pyodide
https://flare.docs.viur.dev
MIT License
33 stars 10 forks source link

Provide a special `<widget>`-Tag on upper-level HTML templates #58

Open phorward opened 2 years ago

phorward commented 2 years ago

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.