6 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
b011cd62a4 Merge pull request #1394 from harvard-edge/feat/socratiq
feat: add socratiq directory (excluding node_modules and dist)
2026-04-24 13:37:04 -04:00
Vijay Janapa Reddi
5f97cca590 Merge remote-tracking branch 'origin/dev' into dev 2026-04-22 16:16:00 -04:00
Vijay Janapa Reddi
b5357f1f02 Fix dark-mode shield + dedup About paper CTA (#1452)
* fix(brand): make SEAS shield PNG transparent so it works in dark mode

The canonical shield (shared/assets/img/logo-seas-shield.png) shipped as
RGB-no-alpha with white pixels in the rectangular bleed around the
curved shield outline. In light mode the white was invisible against
white nav bgs; in dark mode it rendered as a stark white tile around
the shield (visible on StaffML's dark navbar).

Flood-filled the exterior white from the corners with PIL and saved as
RGBA. The interior white "VERITAS" books are isolated from the corners
by the shield's black border and so are preserved (they are the actual
design, not background bleed).

Also added interviews/staffml/public/logo-seas-shield.png to the
sync-mirrors.sh map so the StaffML mirror stays in lockstep with the
canonical asset on future regenerations.

Verified:
  * Build is RGBA (file out/logo-seas-shield.png reports "8-bit/color RGBA")
  * Local dark-mode StaffML navbar: shield blends seamlessly into the
    #212529 navbar bg, no white tile.
  * Local light-mode: indistinguishable from before (the now-transparent
    pixels were previously white-on-white, so no regression).

* fix(staffml/about): drop duplicate "Read the Research Paper" CTA

The /about page had two surfaces pointing at the same StaffML-Paper.pdf:

1. PaperCitationCard at the top (above the fold, PDF + BibTeX) — the
   Phase 6 academic-citation entry point.
2. A second large bordered "Read the Research Paper" CTA card inside
   the "How Questions Are Built" section, with effectively the same
   pitch in different words.

The bottom card duplicated the top card's CTA without adding new
information and visually competed with the citation card a few sections
above. Replaced with a single inline link inside the methodology prose
("…is described in our paper"), so the in-context pointer survives
(this section IS the methodology) without the duplicate visual surface.

Net result: one prominent paper CTA above the fold, one inline
reference where the methodology text actually mentions it.

Also drop now-unused FileText import.
2026-04-22 15:16:39 -04:00
Vijay Janapa Reddi
edbea966bf refactor(tinytorch): rename site-quarto/ to quarto/
Brings the TinyTorch lab guide's Quarto project in line with
book/quarto/, the only other in-tree Quarto publication that builds
both web and PDF outputs from a single source. The previous name had
three redundancies:

  - already under tinytorch/, so "site-" prefix wasn't disambiguating
  - also produces the PDF lab guide, so "site-" was misleading
  - the top-level site/ dir made "site-quarto" read as "the site's
    quarto config" rather than "the tinytorch site, in quarto"

After this rename the convention is straightforward:

  book/quarto/        -> the textbook (web + PDF)
  tinytorch/quarto/   -> the TinyTorch lab guide (web + PDF)
  mlsysim/docs/       -> mlsysim API reference (kept as docs/, since it
                        really is API reference, not a publication)

Touches 7 GitHub workflows, both .gitignore files, the rename target's
own self-references (Makefile, _quarto.yml configs, STYLE.md,
measure-pdf-images.py), and 6 copies of subscribe-modal.js plus a few
shared scripts/configs whose comments documented the old path.

Verified: rebuilt pdf/TinyTorch-Guide.pdf (2.1M) cleanly from the new
location with 'make pdf' from tinytorch/quarto/.
2026-04-22 14:38:18 -04:00
kai4avaya
1e12b3474b refactor: document SocratiQ canonicals in sync-mirrors.sh 2026-04-21 19:32:32 -04:00
Vijay Janapa Reddi
2190968942 refactor: deduplicate subscribe-modal + socratiQ via mirror sync script
Quarto's resource-copy step preserves symlinks rather than dereferencing
them, which breaks both local builds (AlreadyExists on the second pass)
and gh-pages deploys (relative symlink targets fall outside _build/).
And Sass resolves @import relative to the importing file's physical
location, not the symlink target. So symlinks inside the resource path
are not a viable dedup mechanism.

Instead, keep real file copies in each consumer subsite and enforce
dedup at edit time with shared/scripts/sync-mirrors.sh:

  - bash shared/scripts/sync-mirrors.sh           # propagate canonicals
  - bash shared/scripts/sync-mirrors.sh --check   # CI: fail on drift

Mirror map (source | mirrors):
  shared/scripts/subscribe-modal.js -> {site, book/quarto, labs, kits,
                                        mlsysim/docs}/.../subscribe-modal.js

Intentional non-mirrors (left untouched, customized variants):
  tinytorch/site-quarto/assets/scripts/subscribe-modal.js  (TinyTorch-branded)
  tinytorch/site/_static/subscribe-modal.js                (legacy Sphinx)

Also dedupe the SocratiQ widget bundle via a symlink (safe here because
book/tools/ sits outside any Quarto project, so the resource walker
never touches it):

  book/tools/scripts/socratiQ/bundle.js -> ../../../quarto/tools/scripts/socratiQ/bundle.js

The shared canonical (book/quarto/tools/scripts/socratiQ/bundle.js) is
the version actually referenced and served in production.
2026-04-19 10:31:41 -04:00