posit-dev / py-htmltools

Tools for HTML generation and output
MIT License
16 stars 3 forks source link

feat: support htmltools.browsable() methods #79

Open jooyoungseo opened 7 months ago

jooyoungseo commented 7 months ago

In R {htmltools}, there is a way to preview html results in browsers from console via htmltools::browsable(). However, {py-htmltools} does not seem to have htmltools.browsable() methods.

This feature could be possibly integrated in {great_tables} to support some preview results, such as https://github.com/posit-dev/great-tables/issues/100

cpsievert commented 7 months ago

Hi @jooyoungseo. The closest thing we have to browsable() is the .show() method, which should be on any Tag/TagList:

>>> import htmltools
>>> htmltools.div("hello").show()
jooyoungseo commented 7 months ago

@cpsievert -- This is cool! For those coming from R {htmltools} package, are you open to alias this method to browsable() as well?