Skip to main content

sphinx-lightbox

Tests and Docs Deployment PyPI version PyPI - Python Version PyPI - License

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 latexmk and texlive-latex-extra for PDF docs
  • Java 17 or later, curl, and sha256sum for the optional Nu standards gate

License

GPL-3.0-or-later.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_lightbox-0.5.1.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_lightbox-0.5.1-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_lightbox-0.5.1.tar.gz.

File metadata

  • Download URL: sphinx_lightbox-0.5.1.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sphinx_lightbox-0.5.1.tar.gz
Algorithm Hash digest
SHA256 25646473d4d95cc73122e438ba1f0d1c172a035185c2dee02305cab8955bf05c
MD5 449f93f4d425e83bd8995206c0842d4d
BLAKE2b-256 fd08c8b9f3fd73dc71ecc4202d6756afec2f0e6f30d9d49227b2aad464564b8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_lightbox-0.5.1.tar.gz:

Publisher: ci.yml on aputtu/sphinx-lightbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_lightbox-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: sphinx_lightbox-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sphinx_lightbox-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff975c0d6a89a31099898fb5355e85dea6d37273f19165bd40bbfbc760e5c0d3
MD5 9c8f805008152469ad73b05a1e8606e9
BLAKE2b-256 a0739849ec122bc5f8d7f2913dae116bbd15c397b5f88d413e58387752c9cafd

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_lightbox-0.5.1-py3-none-any.whl:

Publisher: ci.yml on aputtu/sphinx-lightbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.6.0

2 files

This release

0.5.1 This release

2 files

0.5.0

2 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