posit-dev / py-htmltools

Tools for HTML generation and output
MIT License
19 stars 4 forks source link

Allows tags to act as context managers #62

Closed jcheng5 closed 1 year ago

jcheng5 commented 1 year ago

While installed, tags insert any sys.displayhook'ed values as children. When exiting, the tag emits itself into sys.displayhook.

wch commented 1 year ago

To install:

pip install git+https://github.com/posit-dev/py-htmltools.git@tags-are-context-managers #egg=htmltools