Skip to main content

htmlsz

Estimate rendered HTML height without a browser.

Usage

from htmlsz import estimate_height

estimate_height("<p>Hello world</p>")
estimate_height('<img src="plot.png">', img_dir=".")

estimate_height is tuned for SolveIt-style HTML fragments such as:

  • markdown rendered into <div class="prose">...
  • Pygments <div class="highlight"><pre>...
  • mixed notebook outputs containing <pre>, <img>, markdown HTML, and raw fragments

It returns content height only. Card chrome and wrapper padding should be added by the caller if needed.

Development

pip install -e .[dev]

Versioning

Version lives in htmlsz/__init__.py as __version__. Bump it with:

ship_bump --part 2   # patch
ship_bump --part 1   # minor
ship_bump --part 0   # major

Release

  1. Ensure your GitHub issues are labeled (bug, enhancement, breaking).
  2. Run:
ship_release_gh
ship_pypi

Metadata

Release files for htmlsz 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for htmlsz 0.1.0
File Size Uploaded
htmlsz-0.1.0.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for htmlsz 0.1.0
File Interpreter ABI Platform
htmlsz-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 kB

Release files / htmlsz-0.1.0.tar.gz

Download URL htmlsz-0.1.0.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a7f118be8374f539a59e119d2b3ac04ba5560dc2e8a6730c6e84f3b9f469e44c
BLAKE2b-256 checksum
How to use checksums
0338ac69d02931adb6c1fdd984f8a6552aa0ed16a3813d4d96e7d48689071fbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / htmlsz-0.1.0-py3-none-any.whl

Download URL htmlsz-0.1.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1afa1f8362a653c10115f49f8cd02cc4dcde6f93f386457bc5f6c7bfeaca0b0b
BLAKE2b-256 checksum
How to use checksums
c1262e65f13043845191f522e4ab0b142b790236fe8305cc0bfa8aea9a1815af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page