Skip to content

Generate the glossary from the Allen Glossary repository - #253

Open
lappalainenj wants to merge 1 commit into
AllenSWDB:mainfrom
lappalainenj:feat-glossary-from-source
Open

Generate the glossary from the Allen Glossary repository#253
lappalainenj wants to merge 1 commit into
AllenSWDB:mainfrom
lappalainenj:feat-glossary-from-source

Conversation

@lappalainenj

Copy link
Copy Markdown

What this does

databook/glossary.md is maintained by hand today. This generates it from
AllenInstitute/allen-connectomics-glossary,
which becomes the single source of truth for the definitions. The databook only reads that
repository; nothing here writes back to it.

The page becomes 249 terms as cards with illustrations, a category legend that doubles as a
filter, and a search box. It stays a single MyST file, so _toc.yml is untouched.

scripts/build-glossary-page.mjs renders a glossary checkout into the page
.github/workflows/sync-glossary.yml regenerates it when the glossary moves, and opens a PR
.github/workflows/publish-glossary.yml on merge to main, publishes just glossary.html to gh-pages

The glossary page executes nothing, so a definition fix reaches the site without waiting
for a capsule run; the other ~120 pages keep whatever the last capsule build deployed. A
capsule build simply overwrites the page with the same content, since it builds from main.

Two things worth a look

requirements.txt is now pinned. The published page links against the _static bundle
already on gh-pages rather than shipping its own, so it has to be built by the same Sphinx
generation as the rest of the site — otherwise it still builds but the theme chrome falls
apart, with header dropdowns rendering as bare bullet lists. jupyter-book==0.15.1
reproduces the deployed theme digest exactly. It is pinned in both requirements.txt and
the publish workflow; change them together, capsule first.

databook/glossary-aliases.json maps the spellings used here onto glossary term ids,
since {term}`basket cell` has to reach an entry called "Basket cell (BC)". Without it
45 references would stop resolving; with it, 2 — CSV, already unresolved on main, and
GFP, which the glossary does not define yet. Net warnings are unchanged from main:
GFP stops resolving, and a duplicate ISI definition goes away.

Verified

Full book builds with jb build -n --keep-going: 56 warnings, the same as main.
Rendered on a fork serving the whole databook, executed notebooks included:
https://lappalainenj.github.io/allenswdb.github.io/glossary.html

databook/glossary.md is generated and carries a do-not-edit header — corrections belong
upstream in the glossary repository.

@lappalainenj
lappalainenj force-pushed the feat-glossary-from-source branch 2 times, most recently from 722884d to a8373e2 Compare August 18, 2026 00:10
databook/glossary.md is maintained by hand today. This generates it from
AllenInstitute/allen-connectomics-glossary, which becomes the single
source of truth for the definitions. The databook only ever reads that
repository; nothing here writes back to it.

The page becomes 249 terms as cards with illustrations, a category legend
that doubles as a filter, and a search box. It stays a single MyST file,
so _toc.yml is untouched and the existing `- file: glossary` entry keeps
working. Cards are rendered at build time rather than in the browser, so
the page is complete HTML before any script runs.

  scripts/build-glossary-page.mjs   renders a glossary checkout into the page
  .github/workflows/sync-glossary.yml     regenerates it and opens a PR
  .github/workflows/publish-glossary.yml  publishes it without a capsule run

The glossary page executes nothing, so Actions can build it alone and put
the single resulting glossary.html on gh-pages; the other ~120 pages keep
whatever the last capsule run deployed. A definition fix therefore
reaches the site without waiting for a full rebuild, at the cost of the
glossary sometimes running slightly ahead of the rest of the book.

The publish workflow pins jupyter-book to 0.15.1, matching the capsule's
own environment file. The published page links against the _static bundle
already on gh-pages instead of shipping its own, so a mismatch renders it
against the wrong stylesheet and the theme chrome falls apart.

databook/glossary-aliases.json maps the spellings the databook writes
onto glossary term ids, since {term}`basket cell` has to reach an entry
called "Basket cell (BC)". Without it this change would leave 45
references unresolved; with it, 2. Mapping by id rather than display name
means rewording a term upstream cannot silently redirect a reference, and
a stale entry is skipped with a warning rather than failing the sync, so
one dead alias cannot freeze every future glossary update.

Against main this is a net wash on build warnings: GFP stops resolving,
and a duplicate ISI definition goes away.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@lappalainenj
lappalainenj force-pushed the feat-glossary-from-source branch from a8373e2 to fbbbe78 Compare August 18, 2026 00:15
@saskiad
saskiad requested a review from leesuyee August 18, 2026 20:56
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.

1 participant