#!/usr/bin/env python3 """Render bible.json into one semantic HTML page per book. Reads the JSON produced by extract_bible.py and writes books/GEN.html and so on, plus an index. The markup carries structure and no presentation: every USFM distinction survives as a class or data attribute, so the whole corpus can be restyled from bible.css without regenerating anything. Grouping worth knowing about: consecutive poetry lines are wrapped in a
that a blank-line block closes, so stanzas are real elements rather than spacing; consecutive list items become one
\n") elif group == "list": out.append(" \n") group = None for block in chapter["blocks"]: btype = block["type"] if btype == "break": close_group() # a blank line ends the stanza continue want = {"line": "poetry", "item": "list"}.get(btype) if want != group: close_group() if want == "poetry": out.append('
\n') elif want == "list": out.append('