From e3b08c29949862e8a3d9388f38f26758b8e1479c Mon Sep 17 00:00:00 2001 From: anon Date: Fri, 10 Jul 2026 16:19:37 +0200 Subject: [PATCH] docs: make section card grids includable from the top-level gallery Wrap each section's card grid in markers and switch the card links/images to root-relative paths (/notebooks/...), which resolve identically on the section index pages and when included elsewhere in the spatialdata-plot docs. This lets docs/gallery.md include these card blocks instead of maintaining a second, hand-curated copy that silently drifts out of sync (scverse/spatialdata-plot#746). Notebooks are only ever rendered inside the parent spatialdata-plot docs (mounted at docs/notebooks/), so the root-relative paths are correct in every build. --- examples/index.md | 10 ++++++---- tutorials/index.md | 14 ++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/examples/index.md b/examples/index.md index a3952f3..44b745b 100644 --- a/examples/index.md +++ b/examples/index.md @@ -2,28 +2,30 @@ Examples from real datasets you'd actually analyse. + ::::{grid} 1 2 2 2 :gutter: 3 :::{grid-item-card} Visium mouse brain -:link: visium_mouse_brain +:link: /notebooks/examples/visium_mouse_brain :link-type: doc -:img-top: ../_static/img/visium_mouse_brain.png +:img-top: /notebooks/_static/img/visium_mouse_brain.png Render H&E tissue, overlay spots, color by gene expression and by cluster, and finish with a publication-style figure. ::: :::{grid-item-card} Interactive region annotation -:link: interactive_annotate +:link: /notebooks/examples/interactive_annotate :link-type: doc -:img-top: ../_static/img/interactive_annotate.png +:img-top: /notebooks/_static/img/interactive_annotate.png Draw regions of interest directly on a `spatialdata-plot` canvas with `sdata.pl.annotate(...)` and persist them as a `ShapesModel` element. ::: :::: + ```{toctree} :hidden: diff --git a/tutorials/index.md b/tutorials/index.md index a31d3d3..a5553d8 100644 --- a/tutorials/index.md +++ b/tutorials/index.md @@ -2,22 +2,23 @@ Entry-point material for learning the API on synthetic data. + ::::{grid} 1 2 2 2 :gutter: 3 :::{grid-item-card} Getting started -:link: getting_started +:link: /notebooks/tutorials/getting_started :link-type: doc -:img-top: ../_static/img/getting_started.png +:img-top: /notebooks/_static/img/getting_started.png The fluent `.pl` API, layering, and styling on the in-memory `blobs` dataset. Ideal first read. ::: :::{grid-item-card} Colour and palettes -:link: color_and_palette +:link: /notebooks/tutorials/color_and_palette :link-type: doc -:img-top: ../_static/img/color_and_palette.png +:img-top: /notebooks/_static/img/color_and_palette.png How `color=` resolves, the v0.3.0 `groups` behaviour, and building perceptually well-spaced or colourblind-safe palettes with @@ -25,9 +26,9 @@ perceptually well-spaced or colourblind-safe palettes with ::: :::{grid-item-card} Speeding up rendering -:link: performance +:link: /notebooks/tutorials/performance :link-type: doc -:img-top: ../_static/img/performance.png +:img-top: /notebooks/_static/img/performance.png Keep rendering fast on large data: automatic rasterization and scale selection for images, and the `datashader` backend for large collections @@ -35,6 +36,7 @@ of shapes and points. ::: :::: + ```{toctree} :hidden: