` tags using CSS classes as a state machine: | CSS class | Content | Action | |-----------|---------|--------| | `p11` | Chapter title | Start new chapter | | `p25` | Verse ref (`Bg 1.1`) | Start new verse | | `p26` | `TEXT 1` header | Confirm verse | | `p28` | Devanagari (Indevr font) | **Skip** — derive from transliteration | | `p29` | Transliteration pāda | Collect into `_padas` list | | `p30` | Synonyms | Parse word—meaning pairs | | `p31`/`p33` | TRANSLATION / PURPORT header | Transition state | | `p32` | Translation text | Extract with HTML | | `p6`/`p12`/`p13` | Purport paragraphs | Collect with HTML | | `p24`/`p34` | "Collier" end marker | Finalize verse | ## RTF → HTML conversion - **Tool**: macOS `textutil` (NOT LibreOffice — it substitutes font names incorrectly, e.g., Indevr → RM Devanagari) - **Prerequisite**: Custom fonts must be installed in `~/Library/Fonts/` before conversion - **Post-processing**: `scripts/inject-fonts.py` adds `@font-face` declarations so browsers can load the custom fonts ```bash # Convert a single RTF textutil -convert html -output public/html/NAME.html public/rtfs/NAME.RTF # Inject fonts into all HTML files python3 scripts/inject-fonts.py ``` ## Current progress - [x] RTF → HTML conversion (all 17 files) - [x] Font injection for browser rendering - [x] Full HTML viewer (iframe-based) - [x] BG extraction script (Chapter 1 complete — 46 verses in 39 files) - [x] BG chapter viewer with verse sidebar - [ ] BG chapters 2-18 - [ ] SB, CC, and other books - [ ] Individual verse pages (`/books/bg/[chapter]/[verse]`)