aboutsummaryrefslogtreecommitdiff
path: root/internal/config/config_test.go
Commit message (Collapse)AuthorAgeFilesLines
* feat(config): reading_lang/reading_version + ReadingCorpus resolverLukasz Kasprzak2026-07-271-0/+20
| | | | | | | | | | | | | | | | Task 3 of national-bibles. Adds reading_lang (any language code) and reading_version (explicit corpus code) config fields, setField cases, renderConfigINI lines + self-documenting header, and Config.ReadingCorpus(): reading_version > reading_lang match > ui_language match > "" (Latin fallback applied by the caller). Also adds an `autoselect` corpus-metadata flag (default true), surfaced during this task: the built-in wuj declares lang=pl, so lang-auto would have re-selected the incomplete Wujek for Polish users and defeated the wuj-drop. wuj.ini now sets autoselect=false, so it is reachable only via an explicit reading_version or --ref; the resolver's language auto-match skips non-autoselectable corpora. A corrected Wujek drop-in (autoselect defaults true) auto-serves Polish with zero config.
* feat(config): 'use' layer stack + CalendarsDir()Lukasz Kasprzak2026-07-271-0/+21
|
* feat(config): migrate to INI + one-shot TOML conversion + calendar SelectionLukasz Kasprzak2026-07-271-2/+39
| | | | | | | config.Load/Save now read/write config.ini; a pre-existing config.toml is converted once (old file kept, reversible). New [calendar] section (epiphany/ascension/corpus_christi) + Config.Selection() feeding the engine. Config struct API unchanged, so daily-readings and web /settings keep working.
* web: /settings page to edit config + books.toml, persisted and applied live; ↵Lukasz Kasprzak2026-07-241-0/+25
| | | | v0.14.0
* books: language-scoped --ref/--list via customizable books.toml + ↵Lukasz Kasprzak2026-07-241-0/+21
| | | | sigla_style config; v0.7.0
* rename the pl scripture version to bt (Biblia Tysiąclecia); v0.4.0Lukasz Kasprzak2026-07-241-1/+1
| | | | | | | | | | The niedziela.pl scraped Polish paragraph text is the Biblia Tysiąclecia translation; rename its version code from "pl" to "bt" and its i18n label to "Biblia Tysiąclecia (niedziela.pl)" everywhere the scripture VERSION is meant, across config, i18n, render, web, tui, cli and both binaries' help text. Language-role "pl" (ui_language, traditional_lang, i18n.Get lang, --lang validation) is untouched. Behavior is identical -- bt is still dropped for offline/traditional and substituted with wuj.
* cli: pager for reading output (-P/--pager, --no-pager, config pager, $PAGER ↵Lukasz Kasprzak2026-07-241-0/+34
| | | | fallback); v0.3.0
* i18n: ui_language config (default en) for UI chrome across cli/tui/web; ↵Lukasz Kasprzak2026-07-231-0/+37
| | | | version labels localised
* config,web: web_versions — which version checkboxes start toggled on in ↵Lukasz Kasprzak2026-07-231-0/+3
| | | | lectio-web
* web: remove deus_vult theme; add global monospace toggle (web_mono config + ↵Lukasz Kasprzak2026-07-231-0/+3
| | | | top-bar 'mono')
* web: horizontal/vertical/interlinear display modes + web_display configLukasz Kasprzak2026-07-231-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* config: add web_theme/web_port fieldsLukasz Kasprzak2026-07-231-0/+25
| | | | | | | | | | | | Add WebTheme (default: "transfiguration") and WebPort (default: 0) to Config for the upcoming lectio-web binary. WebTheme resolves theme names (built-in or user files) later in internal/web; WebPort 0 means auto-pick a free port. - Updated Config struct with new fields - Set defaults in Default() - Updated embedded seed config.toml with documentation - Added TDD tests: TestWebDefaults and TestWebLoadsFromSeed - Existing tests (TestLoadSeeds, TestLoadOverride) still pass
* config: TOML load + seedLukasz Kasprzak2026-07-231-0/+57