Skip to content

Commit ec25e18

Browse files
committed
Update README with automated content generation documentation
1 parent 3c2bfea commit ec25e18

File tree

1 file changed

+178
-9
lines changed

1 file changed

+178
-9
lines changed

README.md

Lines changed: 178 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ The official website for the Contextual Dynamics Lab at Dartmouth College, hoste
1010
contextlab.github.io/
1111
├── index.html # Homepage with animated brain
1212
├── research.html # Research interests and projects
13-
├── people.html # Current members and alumni
14-
├── publications.html # Papers, talks, posters, and course materials
15-
├── software.html # Open-source software projects
13+
├── people.html # Current members and alumni (auto-generated)
14+
├── publications.html # Papers, talks, posters, materials (auto-generated)
15+
├── software.html # Open-source software projects (auto-generated)
1616
├── contact.html # Contact form
1717
├── news.html # Lab news and updates
1818
├── css/
@@ -24,8 +24,21 @@ contextlab.github.io/
2424
│ ├── people/ # Team member photos
2525
│ ├── publications/ # Publication thumbnails
2626
│ └── software/ # Software project images
27-
└── documents/
28-
└── JRM_CV.pdf # Jeremy Manning's CV
27+
├── documents/
28+
│ └── JRM_CV.pdf # Jeremy Manning's CV
29+
├── data/ # Content source files (edit these!)
30+
│ ├── publications.xlsx
31+
│ ├── people.xlsx
32+
│ └── software.xlsx
33+
├── templates/ # HTML templates for auto-generation
34+
│ ├── publications.html
35+
│ ├── people.html
36+
│ └── software.html
37+
├── scripts/ # Build and validation scripts
38+
│ ├── build.py
39+
│ └── ...
40+
└── tests/ # Automated tests
41+
└── ...
2942
```
3043

3144
## Design & Theming
@@ -107,9 +120,165 @@ To update the form endpoint:
107120
2. Create a new form
108121
3. Replace the `action` URL in the form HTML
109122

110-
## Adding Content
123+
## Automated Content Generation
111124

112-
### New Team Member
125+
The publications, people, and software pages are **automatically generated** from Excel spreadsheets. This makes it easy to update content without editing HTML directly.
126+
127+
### How It Works
128+
129+
```
130+
data/ # Source data (edit these!)
131+
├── publications.xlsx # 104 publications
132+
├── people.xlsx # 95 people entries
133+
└── software.xlsx # 20 software items
134+
135+
templates/ # HTML templates with markers
136+
├── publications.html
137+
├── people.html
138+
└── software.html
139+
140+
scripts/ # Build scripts
141+
├── build.py # Master build script
142+
├── build_publications.py
143+
├── build_people.py
144+
├── build_software.py
145+
├── validate_data.py # Data validation
146+
├── pre_push_check.py # Pre-push checks
147+
└── utils.py # Shared utilities
148+
149+
# Generated output (don't edit directly!)
150+
├── publications.html
151+
├── people.html
152+
└── software.html
153+
```
154+
155+
### Updating Content
156+
157+
#### Adding a New Publication
158+
159+
1. Open `data/publications.xlsx` in Excel/Google Sheets
160+
2. Go to the appropriate sheet (`papers`, `preprints`, `chapters`, or `other`)
161+
3. Add a new row with:
162+
- `title` - Publication title
163+
- `title_url` - Link to paper (DOI, PDF, etc.)
164+
- `citation` - Full citation text (can include HTML links)
165+
- `image` - Thumbnail filename (optional, place image in `images/publications/`)
166+
4. Save and push to GitHub (or run build locally)
167+
168+
#### Adding a New Team Member
169+
170+
1. Open `data/people.xlsx` in Excel/Google Sheets
171+
2. Go to the `members` sheet
172+
3. Add a new row with:
173+
- `name` - Person's name
174+
- `name_url` - Personal website (optional)
175+
- `role` - e.g., "grad student", "undergrad", "postdoc"
176+
- `bio` - Biography text
177+
- `image` - Photo filename (place photo in `images/people/`)
178+
4. Save and push to GitHub
179+
180+
#### Adding Alumni
181+
182+
1. Open `data/people.xlsx`
183+
2. Go to the appropriate sheet:
184+
- `alumni_postdocs` - Former postdocs
185+
- `alumni_grads` - Former graduate students
186+
- `alumni_managers` - Former lab managers
187+
- `alumni_undergrads` - Former undergraduates
188+
3. Add a row with:
189+
- `name` - Person's name
190+
- `name_url` - Personal website (optional)
191+
- `current_position` - e.g., "now at Google"
192+
- `current_position_url` - Link to current employer (optional)
193+
194+
#### Adding Software
195+
196+
1. Open `data/software.xlsx`
197+
2. Go to the appropriate sheet (`python`, `javascript`, or `matlab`)
198+
3. Add a new row with:
199+
- `name` - Project name
200+
- `description` - Brief description
201+
- `links_html` - HTML for links, e.g., `[<a href="https://github.com/..." target="_blank">GitHub</a>]`
202+
203+
### Building Locally
204+
205+
```bash
206+
# Install dependencies
207+
pip install -r requirements-build.txt
208+
209+
# Validate data files
210+
python scripts/validate_data.py
211+
212+
# Build all pages
213+
python scripts/build.py
214+
215+
# Or run the full pre-push check
216+
python scripts/pre_push_check.py
217+
```
218+
219+
### Automatic Builds (GitHub Actions)
220+
221+
When you push changes to `data/`, `templates/`, or `scripts/` on the `main` branch, GitHub Actions automatically:
222+
223+
1. Validates all spreadsheet data
224+
2. Rebuilds the HTML pages
225+
3. Runs the test suite (76 tests)
226+
4. Commits and pushes the regenerated HTML
227+
228+
You can also manually trigger a build from the [Actions tab](https://github.com/ContextLab/contextlab.github.io/actions).
229+
230+
### Spreadsheet Field Reference
231+
232+
#### publications.xlsx
233+
234+
| Field | Required | Description |
235+
|-------|----------|-------------|
236+
| `title` | Yes | Publication title |
237+
| `title_url` | No | Link to paper |
238+
| `citation` | Yes | Full citation (HTML allowed) |
239+
| `image` | No | Thumbnail filename |
240+
241+
#### people.xlsx - members sheet
242+
243+
| Field | Required | Description |
244+
|-------|----------|-------------|
245+
| `name` | Yes | Person's name |
246+
| `name_url` | No | Personal website |
247+
| `role` | No | Role in lab |
248+
| `bio` | No | Biography text |
249+
| `image` | No | Photo filename |
250+
251+
#### people.xlsx - alumni sheets
252+
253+
| Field | Required | Description |
254+
|-------|----------|-------------|
255+
| `name` | Yes | Person's name |
256+
| `name_url` | No | Personal website |
257+
| `current_position` | No | Current role/employer |
258+
| `current_position_url` | No | Link to employer |
259+
260+
#### software.xlsx
261+
262+
| Field | Required | Description |
263+
|-------|----------|-------------|
264+
| `name` | Yes | Project name |
265+
| `description` | Yes | Brief description |
266+
| `links_html` | No | HTML links to repo, docs, etc. |
267+
268+
### Tips
269+
270+
- **HTML in cells**: You can use HTML tags in spreadsheet cells (e.g., `<a href="...">`, `<em>`, `<strong>`)
271+
- **Image files**: Place images in the appropriate `images/` subdirectory before referencing them
272+
- **Validation**: Run `python scripts/validate_data.py` to check for missing required fields or broken image references
273+
- **Don't edit generated HTML**: Changes to `publications.html`, `people.html`, and `software.html` in the root directory will be overwritten by the build system
274+
275+
---
276+
277+
## Adding Content (Legacy/Manual Method)
278+
279+
> **Note:** For publications, people, and software pages, use the spreadsheet method above. The manual method below is for other pages or special cases.
280+
281+
### New Team Member (Manual)
113282

114283
1. Add photo to `images/people/` (recommended: 400x400px)
115284
2. Edit `people.html`, add to appropriate section:
@@ -122,7 +291,7 @@ To update the form endpoint:
122291
</div>
123292
```
124293

125-
### New Publication
294+
### New Publication (Manual)
126295

127296
1. Add thumbnail to `images/publications/` (recommended: 500x500px with green border)
128297
2. Edit `publications.html`, add to publications grid:
@@ -138,7 +307,7 @@ To update the form endpoint:
138307
</div>
139308
```
140309

141-
### New Software Project
310+
### New Software Project (Manual)
142311

143312
1. Add screenshot to `images/software/`
144313
2. Edit `software.html`, add to software grid

0 commit comments

Comments
 (0)