Skip to content

Commit 7549160

Browse files
Merge pull request #13 from ContextLab/001-people-labmanual-sync
Sync people data across website, CV, and lab-manual
2 parents c83794c + d51359f commit 7549160

29 files changed

+2634
-270
lines changed

.github/workflows/build-content.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
steps:
2727
- name: Checkout repository
2828
uses: actions/checkout@v4
29+
with:
30+
submodules: true
2931

3032
- name: Set up Python
3133
uses: actions/setup-python@v5

.github/workflows/build-cv.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
steps:
2929
- name: Checkout repository
3030
uses: actions/checkout@v4
31+
with:
32+
submodules: true
3133

3234
- name: Install TeX Live
3335
run: |

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "lab-manual"]
2+
path = lab-manual
3+
url = https://github.com/ContextLab/lab-manual.git

AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ contextlab.github.io/
2020
├── scripts/ # Python build system (see scripts/AGENTS.md)
2121
├── images/ # Assets: people/, publications/, software/, research/, news/
2222
├── documents/ # CV files (JRM_CV.tex → .pdf, .html)
23+
├── lab-manual/ # Git submodule (ContextLab/lab-manual)
2324
└── tests/ # pytest suite for build system
2425
```
2526

@@ -29,7 +30,8 @@ contextlab.github.io/
2930
|------|----------|-------|
3031
| Add publication | `data/publications.xlsx` | Auto-builds via GitHub Actions |
3132
| Add team member | `scripts/onboard_member.py` | Processes photo, generates bio, updates CV |
32-
| Offboard member | `scripts/offboard_member.py` | Moves to alumni, updates CV |
33+
| Offboard member | `scripts/offboard_member.py` | Moves to alumni, updates CV + lab-manual |
34+
| Reconcile people | `scripts/reconcile_people.py` | Three-way sync: people.xlsx ↔ CV ↔ lab-manual |
3335
| Add software | `data/software.xlsx` | |
3436
| Add news | `data/news.xlsx` | Thumbnail in `images/news/` |
3537
| Update CV | `documents/JRM_CV.tex` | Auto-compiles to PDF+HTML |

CLAUDE.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
Static website for the Contextual Dynamics Lab at Dartmouth College. Hosted on GitHub Pages at [context-lab.com](https://context-lab.com). Content pages (publications, people, software, news) are **auto-generated** from Excel spreadsheets via a Python build system — never edit the root HTML for those pages directly.
8+
9+
## Commands
10+
11+
```bash
12+
# Install dependencies
13+
pip install -r requirements-build.txt
14+
15+
# Validate spreadsheet data
16+
cd scripts && python validate_data.py
17+
18+
# Build all content pages (publications, people, software, news)
19+
cd scripts && python build.py
20+
21+
# Build CV (requires XeLaTeX + Dartmouth Ruzicka fonts)
22+
cd scripts && python build_cv.py
23+
24+
# Run full test suite
25+
python -m pytest tests/ -v
26+
27+
# Run a single test file
28+
python -m pytest tests/test_build_publications.py -v
29+
30+
# Pre-push validation (validation + build + tests)
31+
cd scripts && python pre_push_check.py
32+
33+
# Local dev server
34+
python3 -m http.server 8000
35+
36+
# Add hand-drawn borders to images
37+
python scripts/add_borders.py image.png images/publications/
38+
python scripts/add_borders.py photo.jpg images/people/ --face
39+
40+
# Onboard new member (from scripts/ dir)
41+
python onboard_member.py "First Last" --rank "grad student" --photo headshot --skip-llm
42+
43+
# Offboard member to alumni (from scripts/ dir)
44+
python offboard_member.py "member name" --end-year 2025
45+
46+
# Reconcile people across website, CV, and lab-manual
47+
cd scripts && python reconcile_people.py --dry-run # report only
48+
cd scripts && python reconcile_people.py # apply auto-fixes
49+
50+
# Initialize lab-manual submodule (required for reconciliation)
51+
git submodule update --init
52+
```
53+
54+
## Architecture
55+
56+
### Content Pipeline
57+
58+
```
59+
data/*.xlsx → scripts/build_*.py → root *.html (auto-generated)
60+
61+
templates/*.html (markers like <!-- PUBLICATIONS_PAPERS -->)
62+
```
63+
64+
Each `build_*.py` follows the same pattern:
65+
1. Load spreadsheet with `utils.load_spreadsheet_all_sheets()`
66+
2. Generate HTML fragments
67+
3. Inject into template via `utils.inject_content(template, output, {"MARKER": html})`
68+
69+
### Key Directories
70+
71+
| Directory | Purpose |
72+
|-|-|
73+
| `data/` | Source spreadsheets (publications.xlsx, people.xlsx, software.xlsx, news.xlsx) + Dartmouth fonts |
74+
| `templates/` | HTML templates with `<!-- MARKER -->` injection points |
75+
| `scripts/` | Python build system, validation, onboarding/offboarding tools |
76+
| `tests/` | pytest suite — conftest.py adds `scripts/` to sys.path |
77+
| `documents/` | CV source (JRM_CV.tex) and generated outputs (PDF, HTML) |
78+
| `css/style.css` | Single stylesheet with CSS variables at top |
79+
| `js/main.js` | All JS components (9 init functions) |
80+
| `lab-manual/` | Git submodule — [ContextLab/lab-manual](https://github.com/ContextLab/lab-manual) (init with `git submodule update --init`) |
81+
82+
### CV Pipeline
83+
84+
`documents/JRM_CV.tex``scripts/build_cv.py` + `scripts/extract_cv.py` (custom LaTeX→HTML parser) → `documents/JRM_CV.pdf` + `documents/JRM_CV.html`
85+
86+
### GitHub Actions
87+
88+
- **build-content.yml**: Triggers on changes to `data/`, `templates/`, `scripts/`. Validates, builds, runs tests, auto-commits regenerated HTML.
89+
- **build-cv.yml**: Triggers on changes to `documents/JRM_CV.tex`, CV scripts, or `css/cv.css`. Compiles LaTeX, runs tests, auto-commits PDF+HTML.
90+
91+
## Critical Rules
92+
93+
- **Never edit auto-generated root HTML** (`publications.html`, `people.html`, `software.html`, `news.html`) — edit `data/*.xlsx` or `templates/*.html` instead
94+
- **Never use `!important`** in CSS without explicit justification
95+
- **Never add inline styles** to templates — use CSS classes
96+
- **Always run tests before pushing**: `python -m pytest tests/ -v`
97+
- **All headings are lowercase** via `text-transform: lowercase` in CSS
98+
99+
## Design System
100+
101+
- **Colors**: `--primary-green: rgb(0, 112, 60)`, `--bg-green: rgba(0, 112, 60, 0.2)`, `--dark-text: rgba(0, 0, 0, 0.7)`
102+
- **Font**: Nunito Sans, 300 weight body, 14px base, 1.7 line-height
103+
- **Images**: 500x500px with hand-drawn green borders (use `scripts/add_borders.py`), face-detect cropping for people photos (`--face`)
104+
- **Forms**: Formspree backend — endpoint in form `action` attribute

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ The script will:
223223
- Generate or edit the bio using a local LLM (gpt-oss-20b)
224224
- Add the member to `people.xlsx`
225225
- Add the member to `JRM_CV.tex`
226+
- Update `lab_manual.tex` in the lab-manual submodule (if initialized)
226227
- Invite to GitHub organization and teams (if `--github` provided)
227228
- Share Google Calendars with appropriate permissions (if `--gmail` provided)
228229
- Rebuild `people.html`
@@ -268,10 +269,31 @@ python offboard_member.py --list-no-photo
268269
The script will:
269270
- Move the member from `members` sheet to `alumni_undergrads` in `people.xlsx`
270271
- Update `JRM_CV.tex` to add the end date
272+
- Update `lab_manual.tex` in the lab-manual submodule (if initialized)
271273
- Prompt to rebuild `people.html`
272274

273275
**Idempotent**: Running twice with the same name detects the member is already offboarded.
274276

277+
#### Reconciling People Data
278+
279+
The reconciliation tool compares member/alumni data across `people.xlsx` (source of truth), `JRM_CV.tex`, and the lab-manual's `lab_manual.tex`:
280+
281+
```bash
282+
cd scripts
283+
284+
# Report discrepancies without making changes
285+
python reconcile_people.py --dry-run
286+
287+
# Apply auto-fixes (people.xlsx entries missing from other sources)
288+
python reconcile_people.py
289+
```
290+
291+
The tool uses fuzzy name matching to catch spelling variations and nicknames. Discrepancies are categorized as:
292+
- **Auto-resolved**: People in people.xlsx missing from CV or lab-manual (auto-added)
293+
- **Flagged for review**: People in other sources missing from people.xlsx (requires manual review)
294+
295+
**Requires**: Lab-manual submodule initialized (`git submodule update --init`)
296+
275297
#### Adding Alumni (Manual)
276298

277299
1. Open `data/people.xlsx`
@@ -301,6 +323,9 @@ The script will:
301323
# Install dependencies
302324
pip install -r requirements-build.txt
303325

326+
# Initialize lab-manual submodule (required for reconciliation)
327+
git submodule update --init
328+
304329
# Validate data files
305330
python scripts/validate_data.py
306331

data/people.xlsx

363 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)