Skip to content

Commit bb1e0c2

Browse files
Remove test from euclid and start a readme for plugins/ dir
1 parent 59fcd38 commit bb1e0c2

2 files changed

Lines changed: 69 additions & 15 deletions

File tree

plugins/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# IRSA MyST Plugins
2+
3+
Custom [MyST](https://mystmd.org) plugins for the irsa-tutorials.
4+
5+
## Building
6+
7+
```bash
8+
cd plugins
9+
npm install
10+
npm run build
11+
```
12+
13+
This bundles `src/notebook-gallery.mjs` into `dist/notebook-gallery.mjs`. Must *re-run* after any changes to `src/`.
14+
15+
## Registering with MyST
16+
17+
Add the built bundle to `myst.yml`:
18+
19+
```yaml
20+
project:
21+
plugins:
22+
- plugins/dist/notebook-gallery.mjs
23+
```
24+
25+
---
26+
27+
## Plugin: `notebook-gallery` directive
28+
29+
Renders a list of notebooks as a responsive grid of clickable cards. Each card shows a title and a one-sentence description pulled from a shared metadata file.
30+
31+
### Metadata file
32+
33+
The directive argument is a path to a YAML or JSON file (relative to the repo root) that lists notebook metadata. Each entry must have at least:
34+
35+
| Field | Type | Description |
36+
| ------------- | ------ | ---------------------------------------------------- |
37+
| `file` | string | Path to the notebook relative to the repo root |
38+
| `title` | string | Display title shown in the card header |
39+
| `description` | string | One-sentence summary shown in the card body |
40+
41+
Example `notebook_metadata.yml`:
42+
43+
```yaml
44+
- file: tutorials/wise/wise_catalog_search.md
45+
title: WISE Catalog Search
46+
description: Search the AllWISE catalog using astroquery.
47+
- file: tutorials/euclid/1_Euclid_intro_MER_images.md
48+
title: Euclid MER Images
49+
description: Access and visualise Euclid Q1 MER mosaic images.
50+
```
51+
52+
### Directive syntax
53+
54+
````markdown
55+
```{notebook-gallery} notebook_metadata.yml
56+
tutorials/wise/wise_catalog_search.md
57+
tutorials/euclid/1_Euclid_intro_MER_images.md
58+
```
59+
````
60+
61+
- The **argument** (on the opening fence line) is the path to the metadata file.
62+
- The **body** lists one notebook path per line (matching the `file` field in the metadata). Lines starting with `#` are treated as comments.
63+
64+
### Error handling
65+
66+
| Situation | Rendered output |
67+
| ----------------------------------- | -------------------------------------------------------- |
68+
| Metadata file not found / unreadable | An `{error}` admonition with the bad path |
69+
| Notebook path not in metadata | A warning card: _⚠️ Unrecognised notebook_ |

tutorials/euclid/euclid.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,4 @@ tutorials/euclid/merged-objects-hats-catalog/4-euclid-q1-hats-magnitudes.md
2323
tutorials/euclid/euclid-cloud-access.md
2424
tutorials/euclid/euclid_clusters_tutorial.md
2525
tutorials/euclid/Euclid_ERO.md
26-
```
27-
28-
## notebook-gallery exception handling tests
29-
### Invalid notebook path
30-
```{notebook-gallery} notebook_metadata.yml
31-
tutorials/euclid/1_Euclid_intro_MER_images.md
32-
tutorials/euclid/does_not_exist.md
33-
tutorials/euclid/2_Euclid_intro_MER_catalog.md
34-
```
35-
36-
### Invalid metadata path
37-
```{notebook-gallery} does_not_exist.yml
38-
tutorials/euclid/1_Euclid_intro_MER_images.md
39-
tutorials/euclid/2_Euclid_intro_MER_catalog.md
40-
tutorials/euclid/3_Euclid_intro_1D_spectra.md
4126
```

0 commit comments

Comments
 (0)