Htmltools

Latest version: v0.5.1

Safety actively analyzes 623465 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.5.1

* `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)

0.5.0

* 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)

0.4.1

* Fixed deserialization of JSON HTML dependencies when they contained newline characters. (65)

0.4.0

* 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)

0.3.0

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)

0.2.1

Bug fixes

* Fixed the stype signature of the `TagFunction` protocol class.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.