summaryrefslogtreecommitdiff
path: root/docs/superpowers
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 15:00:17 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 15:00:17 +0200
commitaa6c9dad764089a3f0e287b5f90937e97dde3921 (patch)
tree213f7f56bf3c5ca1db82f0eee7c482886fa9ce43 /docs/superpowers
parent66a17fda33e44e9022d6724f850323f754715259 (diff)
downloadlectio-aa6c9dad764089a3f0e287b5f90937e97dde3921.tar.gz
lectio-aa6c9dad764089a3f0e287b5f90937e97dde3921.zip
web: horizontal/vertical/interlinear display modes + web_display config
Adds a display-layout option to lectio-web alongside the existing colour themes: - config: WebDisplay field (toml web_display), default "horizontal", normalized on load via the new exported config.NormalizeDisplay (unknown -> "horizontal", same lenient style as the other web_* fields). - render: extracts the citation/ToEnglishRef resolution shared by GatherVersion into an unexported resolveRef helper (GatherVersion's signature/behavior unchanged) and adds GatherVerses(version, sec, lectionary) returning raw bible.Verse structs plus a versified flag, for column/interlinear alignment. - web/render: RenderReadings gains a display parameter. "horizontal" is the original stacked layout, byte-for-byte the same code path as before. "vertical" reuses the same per-version column data in a .display-vertical/.vcol grid (the CLI compare view, browser-side). "interlinear" maps versions through render.OfflineVersions' pl->wuj substitution (pl has no verse numbers), gathers GatherVerses per version, and interleaves them by chapter:verse into .ilverse/.illine blocks (ordered union of keys, first versified version's order first). - server: adds a display <select> to the top bar wired into the existing #controls HTMX form; a resolveQuery(cfg, r) helper replaces the duplicated date/lectionary/all/versions(+now display) resolution in indexHandler and readingsHandler. - fold-in from the B2 review: indexHandler now populates indexData.Lookup via a shared renderLookup(ref, versions) helper (also used by lookupHandler), so a bookmarked "/?ref=...&v=..." link shows its lookup result instead of an empty pane. - base.css: layout-only rules for the two new modes (no colours; themes stay colour-only). go test ./..., go vet ./..., gofmt clean; go build ./cmd/lectio-web ok.
Diffstat (limited to 'docs/superpowers')
-rw-r--r--docs/superpowers/plans/2026-07-23-lectio-go-rewrite.md32
1 files changed, 32 insertions, 0 deletions
diff --git a/docs/superpowers/plans/2026-07-23-lectio-go-rewrite.md b/docs/superpowers/plans/2026-07-23-lectio-go-rewrite.md
index 6ab484e..af00bb0 100644
--- a/docs/superpowers/plans/2026-07-23-lectio-go-rewrite.md
+++ b/docs/superpowers/plans/2026-07-23-lectio-go-rewrite.md
@@ -1673,6 +1673,38 @@ func TestIndexAndPartial(t *testing.T) {
Add `lectio-web` to the Makefile `build`/`install`/`cross` targets and `.gitignore`;
document `lectio-web`, its keys/controls, and the themes in the README.
+## Addendum C: web display modes (horizontal / vertical / interlinear)
+
+Adds a display-layout option to `lectio-web`, defaulted in config and switchable
+in the top bar. Full task detail in `.superpowers/sdd/task-B3-brief.md`.
+
+### Task B3: internal/web display modes + config `web_display`
+- **config**: add `WebDisplay string` (default `"horizontal"`), normalized to one
+ of `horizontal|vertical|interlinear` (unknown → `horizontal`); seed line in
+ `config.toml`.
+- **render**: add `GatherVerses(version, sec, lectionary) (label string, verses
+ []bible.Verse, versified bool)` — shares GatherVersion's citation/ToEnglishRef/
+ psalm-system resolution but returns raw verses; `versified=false` for `pl` (no
+ verse numbers) and on any lookup failure. Refactor the shared resolution out of
+ GatherVersion so both use it.
+- **web/render**: `RenderReadings(secs, versions, lectionary, display string)`:
+ - `horizontal` — current stacked layout (unchanged).
+ - `vertical` — one column per version (row-index aligned, like CLI `compare`),
+ in a `.display-vertical` grid.
+ - `interlinear` — excludes `pl` (no verse numbers): the version list is mapped
+ through the same pl→wuj substitution as `render.OfflineVersions` (drop pl,
+ substitute wuj if wuj absent), then the versified versions interleave by
+ `chapter:verse` — each verse key printed once (`.vnum`), followed by one
+ `.version-label` + text line per version. Union of verse keys taken in the
+ first version's order, appending any keys later versions add.
+ - Layout for all three lives in `base.css` (colour-only theme constraint intact;
+ new structural elements reuse existing role classes `.vnum`/`.version-label`).
+- **server**: a `display` `<select>` in the top bar (horizontal/vertical/
+ interlinear) carrying `hx-get=/readings`; `/readings` reads `display` (default
+ `cfg.WebDisplay`) and passes it to `RenderReadings`; the `/` page seeds the
+ select from `cfg.WebDisplay`.
+- **README** (folds into Task 14): document the three modes + `web_display`.
+
## Self-Review Notes
- Spec coverage: two binaries (T1,12,13,15-via-14), embedded corpora (T1,4), lookup (T4,5), aliases incl. `J`→John (T3), citation conversion + psalm systems (T2,6), fetch/parse (T7,8), cache HTML+JSON (T8), sigla harvest + offline (T9), config incl. `offline` (T10), render + dedup + pl→wuj (T11), subcommands (T12), colored reader TUI (T13), Makefile/cross/README (T1,14). All spec sections map to a task.