I now have a transform working which generates all the HTML documents and JSON files, and the site JS has been converted from the MoEML system so that it shows documents in-place, and handles the differences in behaviour we've discussed. Styles have also been extensively modified, and the schema has been to some extent constrained (more work to do there).
Note for documentation purposes: all this code lives in the "stpete" repo.