Skip to content

Releases: posit-dev/py-htmltools

htmltools 0.5.2

23 May 15:29
@wch wch
Compare
Choose a tag to compare
  • The HTMLDependency.copy() method can now correctly copy folders in depenendencies that both include directories and have all_files=True. (#87)

htmltools 0.5.1

18 Dec 23:32
@wch wch
Compare
Choose a tag to compare
  • Tag objects can now be used as context managers, as in with tags.div():. When used this way, then inside the with block, sys.displayhook is replaced with a function which adds items as children to the Tag. This is meant to be used with Shiny Express, Quarto, or Jupyter. (#76)

  • Added a function wrap_displayhook_handler(). This alliows displayhooks to delegate their logic for handling various kinds of objects (like Tag objects and objects with a _repr_html()) to this function. (#77)

htmltools 0.5.0

07 Dec 21:55
@wch wch
Compare
Choose a tag to compare
  • Objects with a _repr_html_ method can now appear as children of Tag/TagList objects. (#74)

  • Changed the type annotation of _add_ws from bool to TagAttrValue. This makes it easier to write functions which call Tag functions and pass along **kwargs. (#67)

  • Changed the type annotation of collapse_ from str to str | float | None. This makes it easier to write calls to css() pass along **kwargs. (#68)

  • Enhanced the type definition of TagAttrs to include TagAttrDict, the type of a Tag's attrs property. (#55)

  • For HTMLTextDocument objects, deduplicate HTML dependencies. (#72)

  • Switched from setup.cfg and setup.py to pyproject.toml. (#73)

htmltools 0.4.1

30 Oct 23:44
@wch wch
Compare
Choose a tag to compare
  • Fixed deserialization of JSON HTML dependencies when they contained newline characters. (#65)

htmltools 0.4.0

30 Oct 20:39
0b3eee2
Compare
Choose a tag to compare
  • Added HTMLTextDocument class, which takes as input a string representation of an HTML document. (#61)

  • Added htmltools.html_dependency_render_mode. If this is set to "json", then HTMLDependency objects will be rendered as JSON inside of <script> tags. (#61)

htmltools 0.3.0

01 Aug 21:29
@wch wch
Compare
Choose a tag to compare

New features

  • Added Tag methods remove_class and add_style. (#57)

  • Added support for Tag's add_class(prepend=). (#57)

Other changes

  • Dropped support for Python 3.7 (#56)

htmltools 0.2.1

03 Apr 20:10
@wch wch
Compare
Choose a tag to compare

Bug fixes

  • Fixed the stype signature of the TagFunction protocol class.

htmltools 0.2.0

03 Apr 19:20
@wch wch
Compare
Choose a tag to compare

New features

  • Added support for URL based HTMLDependency objects. (#53)

  • Tag functions now have a boolean parameter _add_ws, which determines if the tag should be surrounded by whitespace. Tags which are normally block elements (like div) have this default to True, and tags which are normally inline elements (like span) have this default to False. This makes it possible to create HTML where neighboring elements have no whitespace between them. For example, span(span("a"), span("b")) will now yield <span><span>a</span><span>b</span></span>. (#54)

htmltools 0.1.5

11 Mar 18:32
@wch wch
Compare
Choose a tag to compare

New features

  • Changed types hints for Tag functions. The new types are TagChild, TagNode, TagAttrValue, and TagAttrs. (#51)

  • Add public-facing html_escape function.

Bug fixes

  • Removed default argument values which were mutable objects.

Other changes

  • Moved packages from requirements-dev.txt to setup.cfg.

htmltools 0.1.4

02 Mar 15:18
@wch wch
Compare
Choose a tag to compare

Bug fixes

  • Added alias for htmltools._util._package_dir function, which was used by shinywidgets 0.1.4.