Click-to-enlarge images for Sphinx documentation
Project description
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 build |
Build distributions, run twine check, and validate archive contents |
make all |
Run check, docs, 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
License
GPL-3.0-or-later.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sphinx_lightbox-0.5.0.tar.gz.
File metadata
- Download URL: sphinx_lightbox-0.5.0.tar.gz
- Upload date:
- Size: 29.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
189fc20329b64b9db23da58c24627136ee3c8e394a647244418114163ee23e8f
|
|
| MD5 |
5b9f929c33ac27f0373f7caeb34231fd
|
|
| BLAKE2b-256 |
e21fc0f8eba0b7c91e549e503603daaee3743850c57b2af98ea0a91e0441190f
|
Provenance
The following attestation bundles were made for sphinx_lightbox-0.5.0.tar.gz:
Publisher:
ci.yml on aputtu/sphinx-lightbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_lightbox-0.5.0.tar.gz -
Subject digest:
189fc20329b64b9db23da58c24627136ee3c8e394a647244418114163ee23e8f - Sigstore transparency entry: 2036198527
- Sigstore integration time:
-
Permalink:
aputtu/sphinx-lightbox@5163800dd700b4b7287dead2263db0fbbb4b7781 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/aputtu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@5163800dd700b4b7287dead2263db0fbbb4b7781 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sphinx_lightbox-0.5.0-py3-none-any.whl.
File metadata
- Download URL: sphinx_lightbox-0.5.0-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4c0d130d6d54978436695f7659bf89cf3d77298ec1fd60a60a09d512223b708
|
|
| MD5 |
224977dc510d23410dc1d0648fd99967
|
|
| BLAKE2b-256 |
5e379de8e5f1561dc283862729eedd13af445104a8bbff71e7a59ab179f4dfef
|
Provenance
The following attestation bundles were made for sphinx_lightbox-0.5.0-py3-none-any.whl:
Publisher:
ci.yml on aputtu/sphinx-lightbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_lightbox-0.5.0-py3-none-any.whl -
Subject digest:
a4c0d130d6d54978436695f7659bf89cf3d77298ec1fd60a60a09d512223b708 - Sigstore transparency entry: 2036199047
- Sigstore integration time:
-
Permalink:
aputtu/sphinx-lightbox@5163800dd700b4b7287dead2263db0fbbb4b7781 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/aputtu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@5163800dd700b4b7287dead2263db0fbbb4b7781 -
Trigger Event:
push
-
Statement type: