diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-23 15:00:17 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-23 15:00:17 +0200 |
| commit | aa6c9dad764089a3f0e287b5f90937e97dde3921 (patch) | |
| tree | 213f7f56bf3c5ca1db82f0eee7c482886fa9ce43 /internal/web/static | |
| parent | 66a17fda33e44e9022d6724f850323f754715259 (diff) | |
| download | lectio-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 'internal/web/static')
| -rw-r--r-- | internal/web/static/base.css | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/internal/web/static/base.css b/internal/web/static/base.css index f99b4b5..220badd 100644 --- a/internal/web/static/base.css +++ b/internal/web/static/base.css @@ -144,6 +144,51 @@ body { margin-right: 0.35em; } +/* Vertical display: versions side by side in columns, like the CLI + * `compare` view. A fixed --vcols track count (not auto-fit) means the + * grid's total width is always the page container's, so it wraps extra + * versions onto further rows instead of ever forcing horizontal scroll. */ +.display-vertical { + display: grid; + grid-template-columns: repeat(var(--vcols, 2), 1fr); + gap: var(--space-3) var(--space-4); + align-items: start; +} + +.vcol { + min-width: 0; +} + +/* Interlinear display: one .ilverse block per chapter:verse key, one + * .illine per version that carries it. */ +.display-interlinear { + display: flex; + flex-direction: column; +} + +.ilverse { + margin: 0 0 var(--space-3); + padding-top: var(--space-1); + border-top-width: 1px; + border-top-style: solid; +} + +.ilverse:first-child { + border-top-width: 0; + padding-top: 0; +} + +.illine { + margin: 0.2rem 0 0.2rem var(--space-2); +} + +.illine .version-label { + display: inline; + margin: 0 0.5em 0 0; + padding-bottom: 0; + border-bottom-width: 0; +} + a { text-decoration: underline; text-underline-offset: 0.15em; @@ -160,4 +205,7 @@ a { .heading { font-size: 1.25rem; } + .display-vertical { + grid-template-columns: 1fr; + } } |
