Skip to content

feat: KaTeX math rendering + image lightbox for articles#51

Merged
viniciusdc merged 1 commit into
mainfrom
feat/article-katex-and-lightbox
May 19, 2026
Merged

feat: KaTeX math rendering + image lightbox for articles#51
viniciusdc merged 1 commit into
mainfrom
feat/article-katex-and-lightbox

Conversation

@viniciusdc

Copy link
Copy Markdown
Owner

Summary

Schema/config support that #22 (protein essay) and #18 (k8s benchmark note) both depend on. Extracted into a single PR so the content PRs can be reduced to just their prose.

After this lands, both #22 and #18 rebase to drop their schema/config commits and become pure prose+figure PRs.

What's in it

KaTeX math rendering

  • Wire remark-math + rehype-katex into the MDX integration in astro.config.mjs so equations render at build time (no client JS).
  • Add katex, rehype-katex, remark-math as deps.
  • Import katex/dist/katex.min.css in global.css with a small dark-theme override block so math sits in the warm palette instead of black/white.

Image lightbox

  • Extract the lightbox HTML/CSS/JS from the inline form in feat: protein distance geometry essay + fix project card #22 into src/components/ui/ImageLightbox.astro — a self-contained component.
  • Include once in ArticleLayout. Any .article-content figure img now gets click-to-zoom (close on backdrop / X button / Escape, no deps).
  • Max sizes tuned for readability: 1100px / 88vh.

cspell.json

  • Vocabulary the pending content PRs need so they pass spell-check after rebasing down to pure content:
    • K8s benchmark: `journalctl`, `systemd`
    • LaTeX/math vocabulary used by the protein essay: `lightbox`, `eigencomponents`, `mathbb`, `mathbf`, `mathcal`, `bigl`, `bigr`
    • Names from the protein essay: `Schoenberg`, `Wüthrich`, `ChimeraX`, `PIBIC`, `RMSD`, `MDE`, `RCSB`, `PGDm`, `Gonçalves`, `Birgin`, `Martínez`, `Raydan`, `UCSF`

What's not in it

Test plan

Schema/config support that #22 (protein essay) and #18 (k8s benchmark
note) both depend on. Extracted to a single PR so the content PRs can
be reduced to just their prose.

KaTeX:
- Wire remark-math + rehype-katex into MDX in astro.config.mjs so
  math renders at build time (no client JS).
- Add katex / rehype-katex / remark-math as deps.
- Import katex.min.css in global.css with a small dark-theme override
  block so equations sit in the warm palette instead of black/white.

ImageLightbox:
- Extract the inline lightbox HTML/CSS/JS into
  src/components/ui/ImageLightbox.astro — a single component included
  once in ArticleLayout. Any .article-content figure image now gets
  click-to-zoom (close on backdrop / X button / Escape, no deps).

cspell.json:
- Add the names and terms used by both pending content PRs so they
  pass spell-check after they rebase down to pure content:
  - K8s benchmark note: journalctl, systemd
  - Math/LaTeX vocabulary: lightbox, eigencomponents, mathbb, mathbf,
    mathcal, bigl, bigr
  - Protein essay names: Schoenberg, Wüthrich, ChimeraX, PIBIC, RMSD,
    MDE, RCSB, PGDm, Gonçalves, Birgin, Martínez, Raydan, UCSF

After this lands, both #22 and #18 can rebase to drop their
schema/config commits and become pure prose+figure PRs.
@viniciusdc viniciusdc merged commit d77d48c into main May 19, 2026
6 checks passed
@viniciusdc viniciusdc deleted the feat/article-katex-and-lightbox branch May 19, 2026 18:28
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