sphinx-lightbox
sphinx-lightbox is a Sphinx extension that turns standard .. image::
and .. figure:: directives into click-to-enlarge images in HTML output.
It uses a CSS checkbox-toggle mechanism, progressively enhanced with a small
JavaScript file for keyboard activation, focus management, Escape-to-close,
and optional gallery navigation.
Documentation is published at https://aputtu.github.io/sphinx-lightbox/.
Quick Start
pip install sphinx-lightbox
Enable the extension in conf.py:
extensions = ["lightbox"]
Opt a standard image into lightbox behavior:
.. image:: /images/example.png
:alt: Example image.
:class: lightbox
Figures are transformed by default and keep their normal page caption:
.. figure:: /images/example.png
:alt: Example figure.
This caption is also shown in the lightbox overlay.
Development
Create a local virtual environment and install development dependencies:
make setup
Common commands:
| Command | Description |
|---|---|
make test |
Run the pytest suite |
make lint |
Run ruff check and ruff format --check |
make type |
Run mypy |
make check |
Run lint, type checks, and tests |
make docs |
Build PDF docs, HTML docs, and validate generated HTML |
make standards |
Validate generated HTML, CSS, and SVG with the Nu checker |
make build |
Build distributions, run twine check, and validate archive contents |
make all |
Run check, docs, standards, build, and dependency audit |
The documentation build writes HTML to docs/_build/html/ and copies the PDF
download into docs/_downloads/sphinx-lightbox.pdf before rebuilding HTML, the
same pattern used by the GitHub Pages deployment workflow.
Project Layout
sphinx-lightbox/
|-- lightbox/ Extension package
| |-- lightbox.py
| |-- py.typed
| `-- static/
| |-- lightbox.css
| `-- lightbox.js
|-- docs/ Sphinx documentation source
| |-- _ext/ Docs-only validation fixes
| |-- _templates/ Accessible theme template overrides
| |-- _downloads/ Generated PDF download location
| `-- images/ Example images
|-- requirements/ Base, development, and docs requirements
|-- scripts/ Local development and validation helpers
|-- tests/ Unit and integration tests
|-- pyproject.toml
|-- tox.ini
`-- Makefile
Requirements
- Python 3.10 or later
- Sphinx 7.0 through 9.x
- LaTeX tooling such as
latexmkandtexlive-latex-extrafor PDF docs - Java 17 or later,
curl, andsha256sumfor the optional Nu standards gate
License
GPL-3.0-or-later.
Metadata
Release files for sphinx-lightbox 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sphinx_lightbox-0.6.0.tar.gz | 36.2 kB | With provenance | Details for sphinx_lightbox-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sphinx_lightbox-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for sphinx_lightbox-0.6.0-py3-none-any.whl |
Total release size: 72.7 kB
Release files / sphinx_lightbox-0.6.0.tar.gz
| Download URL | sphinx_lightbox-0.6.0.tar.gz |
|---|---|
| Size | 36.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb91a5459e3eee6f7309f1afa5d553eec381862fe1e80e15efaf2e1089184ff7
|
|
BLAKE2b-256 checksum How to use checksums |
30c6400f3baeff9349f6c8ed8fa66523128e5553bf727e3d4cd6535a8da42be9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / sphinx_lightbox-0.6.0-py3-none-any.whl
| Download URL | sphinx_lightbox-0.6.0-py3-none-any.whl |
|---|---|
| Size | 36.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de96ccc0e1ae235988203dadb72b99a61092c8236a748cd1dbc07d5ccff164dc
|
|
BLAKE2b-256 checksum How to use checksums |
f6df6f8b016b91076d620653bcf9b1a4ad2c7b3eb7fd217d0beef56805c7b4ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logSecurity for sphinx-lightbox 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sphinx_lightbox-0.6.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.