Skip to content

Store JATS full text for publications, drop redundant abstracts from pubs.yaml - #206

Open
aarmey wants to merge 3 commits into
mainfrom
jats-publication-abstracts
Open

Store JATS full text for publications, drop redundant abstracts from pubs.yaml#206
aarmey wants to merge 3 commits into
mainfrom
jats-publication-abstracts

Conversation

@aarmey

@aarmey aarmey commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Downloads and commits JATS XML from PMC (data/JATS/PMC<id>.xml) for the 49 publications with a resolvable PMC record
  • Removes the now-redundant abstract field from data/pubs.yaml for the 48 entries a JATS file covers (2,849 → 1,983 lines); all other fields verified byte-identical, and entries with no PMC record keep their YAML abstract as a fallback
  • Hugo's pubentry partial now extracts the abstract from JATS at build time (layouts/partials/jats-abstract.html) via regex tag-stripping — deliberately not Hugo's built-in XML unmarshaler, which was confirmed to silently drop text around inline <italic>/<sup> tags
  • scripts/fetch_jats.py is a reusable script (uv run --with ruamel.yaml scripts/fetch_jats.py) to refresh JATS as new PMID'd publications are added
  • _CV/CV.typ and all other pubs.yaml fields are untouched — the Typst CV build reads locator fields directly from YAML and doesn't need JATS

Test plan

  • hugo --minify builds clean
  • Verified rendered abstract for: a full-text JATS entry, a front-matter-only JATS entry (correctly skips the "Significance" executive summary and picks the real abstract), an entry with no PMC record (YAML fallback), and an entry with no abstract in JATS at all (toggle correctly omitted)
  • typst compile --root . _CV/CV.typ builds clean; publication list in the rendered PDF unaffected
  • Structural diff confirms the only changes to pubs.yaml are abstract removal and pmcid addition — no other field values changed

🤖 Generated with Claude Code

https://claude.ai/code/session_01Uc6rqkTyBH75kNfrirbxZE

Aaron Meyer added 3 commits August 27, 2026 07:56
…pubs.yaml

Downloads and commits JATS XML from PMC for 49 publications, then removes
the now-redundant `abstract` field from data/pubs.yaml wherever a JATS file
covers it (48 entries), cutting the file from 2,849 to 1,983 lines. Hugo's
pubentry partial now extracts the abstract from JATS at build time via
regex tag-stripping, falling back to the YAML field where no JATS file
exists. CV.typ and other pubs.yaml fields are untouched, so the Typst CV
build is unaffected. scripts/fetch_jats.py is reusable to refresh JATS
as new PMID'd publications are added.
Extracts plain text from JATS XML via pandoc's native JATS reader
(scripts/extract_fulltext.py, gitignored fulltext/ output — regenerable
from committed JATS files), generates one page per publication via a
Hugo content adapter (content/publications/_content.gotmpl +
layouts/pub/single.html) so Pagefind has something to index, and adds
a lazy-loaded search box to the publications list page. Pagefind's
JS/WASM/index (~150KB gzipped for the initial load) only fetches on
first interaction with the search input, so browsing the site normally
adds zero bytes. CI now runs pandoc extraction and `pagefind --site _site`
after the Hugo build.
Silences Hugo's deprecation warning (languageCode was deprecated in
v0.158.0 in favor of locale); output is unchanged.
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