Henry M. Blair
This site · Static site generator · Python · henryblair.online
Static site generator · Python · henryblair.online

This site

Henry M. Blair

Most academic websites are a CV with pictures. The problem with that is drift: the moment a number is typed into a page it stops being the number in the analysis. This one was built so that cannot happen — the page asks the workbook, at build time and again in the reader’s browser.

7,143
lines of Python
69
pages built
11
live workbooks
26
passphrase-gated files
Status. Live at henryblair.online, rebuilt by one command and published from a public repository.

The idea

A project page carries perhaps fifty numbers — cohort sizes, rates, risk ratios, confidence intervals. Every one of them exists already, in a cell of the workbook where the analysis was done. Copying them into HTML creates a second copy that is correct exactly once, on the day it is pasted.

So no number on this site is typed. Each is written as a span that names the row it comes from. At build time the generator fetches the sheet and fills them in; when the page loads, a small script fetches the same sheet again and overwrites what it finds. The page is right before any JavaScript runs, and right again a minute after the spreadsheet changes.

Eleven workbooks feed the site this way, across ADT, vaginal estrogen, PVR, deprivation, the urogynaecology survey and six NSQIP studies. Two cohort-derivation diagrams are drawn as SVG from the same source, so even the figures move when the data does.

How it is put together

Why it is built this way

The honest reason is that I kept finding stale numbers. A figure would be regenerated, a workbook corrected after a reviewer’s comment, and the page would quietly keep the old value. Making the page ask the workbook every time is the only version of this that stays true without discipline.

The second reason is that a reader should be able to check. Every page says which workbook and which sheet a number came from, and the derivation diagrams name the query behind each cohort. That is a weaker claim than reproducibility, but it is a real one, and most sites of this kind do not make it.

What comes next

A drift check that fails the build when a page’s baked value and its workbook disagree by more than rounding — so a stale number stops being a thing a reader might notice first.

Counted at the last build.