Lightbox Plugin¶
A MyST plugin that automatically turns every figure and image on a page into a clickable lightbox, with caption, zoom, and gallery navigation.
Usage: Simply enable it in your myst.yml plugins list:
project:
plugins:
- https://raw.githubusercontent.com/choldgraf/myst-lightbox/main/src/index.mjsIt will automatically identify each image and figure in your content and make it lightboxed, if no link exists.
For example, click any image below.
A figure with a caption¶
This uses a myst {figure} directive:

A mountain lake at dusk (the caption is shown in the lightbox too!).
A plain Markdown image¶
This uses markdown image syntax like ![]():

The {image} role¶
This uses the {image} role:

How it works¶
The plugin loads GLightbox from a CDN at page load and wires every figure/image in the page content as a single gallery. Click → open. Arrow keys → next/prev. +/- → zoom. Esc → close.
myst.yml
version: 1
project:
id: myst-lightbox
title: myst-lightbox
github: https://github.com/choldgraf/myst-lightbox
jupyter:
binder:
repo: https://github.com/executablebooks/thebe-binder-base
plugins:
- ../src/index.mjs
toc:
- file: index.md
- file: reference.md
site:
template: book-theme
options:
logo_text: myst-lightbox
docs/myst.yml