keller-mark / with-html

(Ab)use python context managers to construct HTML
MIT License
0 stars 0 forks source link

Support including anywidgets as nodes #1

Open keller-mark opened 2 months ago

keller-mark commented 2 months ago

Either

Is this the desired API:?


class MyWidget(AnyWidget):
    # ...

w = MyWidget()

with h.div():
    h.p("my paragraph")
    h(w)
    h.p("another paragraph")
keller-mark commented 2 months ago

Working implementation in https://github.com/keller-mark/with-html/commit/cdd7250cdc9aa1d60d07f9f07935c59506b5b46c

Styles seem to be buggy (probably due to React+vanillaJS interactions), and have not implemented support for initialize, cleanup of render function, or experimental.invoke