Skip to content

docs(gallery): derive the gallery from the notebook sources#752

Merged
timtreis merged 1 commit into
mainfrom
fix/issue-746
Jul 10, 2026
Merged

docs(gallery): derive the gallery from the notebook sources#752
timtreis merged 1 commit into
mainfrom
fix/issue-746

Conversation

@timtreis

Copy link
Copy Markdown
Member

Fixes #746.

Problem

The Gallery page (docs/gallery.md) duplicated the per-notebook grid cards that also live in the notebooks submodule's section index pages (notebooks/tutorials/index, notebooks/examples/index). Because the two lists are maintained independently in separate repos, they drift: adding a notebook requires editing both, and when gallery.md is missed the Gallery silently omits the notebook.

That's exactly what happened with "Interactive region annotation" — present on the Examples index page but missing from the Gallery on stable (v0.4.0). #689 patched that one card on main, but the structural drift remained.

Fix

Make the section index pages (which live next to the notebooks) the single source. docs/gallery.md keeps its intro and a visible {toctree} to those pages instead of re-listing cards, so every notebook appears automatically and the Gallery can never fall out of sync. Removed the now-orphaned card images under _static/gallery/ (the section cards use _static/img/).

Verification

Built the docs (nb_execution_mode = "off"): the generated gallery.html links all notebooks — including a WIP normalization_and_contrast tutorial that has no gallery.md card, proving a new notebook now shows up with zero gallery.md edits. No new gallery/toctree warnings.

Notes

  • Docs-only; no code or public-API change.
  • Trade-off: the Gallery landing page shows a nested notebook list rather than inline image cards; the cards remain one click away on the section index pages. If inline cards are preferred, a follow-up could {include} the section card blocks instead — but the toctree is the drift-proof, single-repo change.

@timtreis timtreis changed the title docs(gallery): derive the gallery from the notebook sources (fixes #746) docs(gallery): derive the gallery from the notebook sources Jul 10, 2026
@timtreis timtreis force-pushed the fix/issue-746 branch 2 times, most recently from b51c448 to 391bf18 Compare July 10, 2026 14:34
The Gallery page duplicated the per-notebook cards that also live in the
notebooks submodule's section index pages, and the two lists drifted across
repos: a notebook added to the submodule but not carded in gallery.md was
silently missing from the gallery (e.g. 'Interactive region annotation').

Include the section card blocks from the submodule (scverse/spatialdata-plot-notebooks#11
added the markers and root-relative paths) instead of maintaining a second
copy, and bump the submodule pin. gallery.html now renders these exact tiles
from a single source, so a newly added notebook appears automatically and the
gallery can never fall out of sync. Removes the now-orphaned _static/gallery
images (the section cards use _static/img).

Fixes #746.
@timtreis timtreis merged commit 97241bb into main Jul 10, 2026
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs gallery doesn't show all notebooks

1 participant