Skip to content

Commit 8e5a9a3

Browse files
committed
Add Makefile, update_all.sh
1 parent 4fe1ef8 commit 8e5a9a3

File tree

3 files changed

+90
-10
lines changed

3 files changed

+90
-10
lines changed

MAINTENANCE.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Diffusion Lighthouse website safely and correctly.
1313

1414
| You change… | You must run… |
1515
|------------|---------------|
16-
| Paper metadata (titles, venues, relations, tags, notes) | `build_dataset.py` |
17-
| Citation counts | `update_citations.py``build_dataset.py` |
16+
| Paper metadata (titles, venues, relations, tags, notes) | `python scripts/build_dataset.py` |
17+
| Citation counts | `python scripts/update_citations.py``python scripts/build_dataset.py` |
1818
| UI / wording / behavior | edit files in `site/` only |
1919
| README framing | edit README only (no build needed) |
2020

@@ -99,7 +99,7 @@ This is the most common cause of:
9999
Quick checks:
100100

101101
```bash
102-
ls site/public/data/papers.json
102+
ls -lh site/public/data/papers.json
103103
```
104104

105105
Paper count:
@@ -125,9 +125,11 @@ PY
125125

126126
### 5️⃣ View the site locally
127127

128+
From the repo root:
129+
128130
```bash
129131
cd site
130-
python -m http.server
132+
python -m http.server 8000
131133
```
132134

133135
Open:
@@ -137,7 +139,7 @@ http://localhost:8000
137139

138140
Hard refresh if needed:
139141
- macOS: `Cmd + Shift + R`
140-
- Linux / Windows: `Ctrl + Shift + R`
142+
- Windows/Linux: `Ctrl + Shift + R`
141143

142144
---
143145

@@ -159,10 +161,15 @@ site/style.css
159161

160162
---
161163

162-
### Quick sanity check
164+
### 7️⃣ Run doctor checks (recommended)
165+
163166
```bash
164167
python scripts/doctor.py
168+
```
165169

170+
If the doctor fails, fix issues **in YAML** or the scripts — do **not** hand-edit `papers.json`.
171+
172+
---
166173

167174
## 🧠 Mental model (important)
168175

@@ -183,6 +190,7 @@ If something looks wrong on the site:
183190
- Expecting README edits to affect the website
184191
- Treating missing citations as errors
185192
- Editing `papers.json` directly (it is a build artifact)
193+
- Running the site from the wrong folder (serve from `site/`)
186194

187195
---
188196

@@ -191,8 +199,8 @@ If something looks wrong on the site:
191199
Stop iterating if:
192200
- the site loads correctly
193201
- papers render and open
194-
- relations work
195-
- links resolve
202+
- relations work (incoming/outgoing shown in modal)
203+
- links resolve to canonical sources
196204

197205
Citation completeness is **explicitly not a goal**.
198206

@@ -206,8 +214,9 @@ Every update:
206214
1. Edit data/papers.yaml
207215
2. (Optional) python scripts/update_citations.py
208216
3. python scripts/build_dataset.py ← required
209-
4. Refresh site
210-
5. Commit & push
217+
4. cd site && python -m http.server 8000
218+
5. Refresh site
219+
6. Commit & push
211220
```
212221

213222
---

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.PHONY: update update-no-citations serve
2+
3+
update:
4+
bash scripts/update_all.sh
5+
6+
update-no-citations:
7+
bash scripts/update_all.sh --no-citations
8+
9+
serve:
10+
bash scripts/update_all.sh --serve

scripts/update_all.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Diffusion Lighthouse — update pipeline
5+
# Usage:
6+
# bash scripts/update_all.sh
7+
# bash scripts/update_all.sh --no-citations
8+
# bash scripts/update_all.sh --serve
9+
# bash scripts/update_all.sh --no-citations --serve
10+
11+
NO_CITATIONS=0
12+
SERVE=0
13+
14+
for arg in "$@"; do
15+
case "$arg" in
16+
--no-citations) NO_CITATIONS=1 ;;
17+
--serve) SERVE=1 ;;
18+
*) echo "Unknown arg: $arg" && exit 1 ;;
19+
esac
20+
done
21+
22+
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
23+
24+
echo "== Diffusion Lighthouse update =="
25+
cd "$root_dir"
26+
27+
echo ""
28+
echo "[1/4] Validate YAML"
29+
# If your validator is different, swap this line to your actual validate command.
30+
python -m scripts.validate
31+
32+
echo ""
33+
if [[ "$NO_CITATIONS" -eq 1 ]]; then
34+
echo "[2/4] Update citations: SKIPPED (--no-citations)"
35+
else
36+
echo "[2/4] Update citations (best-effort)"
37+
# If this occasionally fails due to blocks, the whole pipeline shouldn't die.
38+
# You can remove the '|| true' if you prefer hard-fail.
39+
python scripts/update_citations.py || {
40+
echo "WARN: citation updater failed (blocked/rate-limited). Continuing build..."
41+
}
42+
fi
43+
44+
echo ""
45+
echo "[3/4] Build dataset (writes site/public/data/papers.json)"
46+
python scripts/build_dataset.py
47+
48+
echo ""
49+
echo "[4/4] Doctor checks (stale build, missing links, etc.)"
50+
python scripts/doctor.py
51+
52+
echo ""
53+
echo "✅ Done."
54+
55+
if [[ "$SERVE" -eq 1 ]]; then
56+
echo ""
57+
echo "Serving site/ at http://localhost:8000"
58+
echo "Ctrl+C to stop."
59+
cd "$root_dir/site"
60+
python -m http.server 8000
61+
fi

0 commit comments

Comments
 (0)