aboutsummaryrefslogtreecommitdiff
path: root/internal/cli/cli.go
Commit message (Collapse)AuthorAgeFilesLines
* cli: --year N prints the year's key liturgical datesLukasz Kasprzak2026-07-291-1/+7
| | | | | | | | | On its own, `--year N` now prints a human-readable overview of the year's key dates -- season boundaries, solemnities and feasts of the Lord -- computed from the engine for the configured form (and custom-calendar layers), paged when a pager is configured. With --format json|ical it still emits the machine calendar (runFeed) as before. Numbered seasonal Sundays and Octave weekdays are omitted from the solemnity list (the season boundary already marks them).
* help: refresh -h/--help for lectio, lectio-ui, lectio-webLukasz Kasprzak2026-07-281-4/+11
| | | | | | | | | | | | | | | | The help text predated this session's changes. Update all three binaries: - Taglines: drop "(Polish + 4 versions)" -> "offline ... daily readings (OF + EF)". - Versions: state that only the Latin Vulgate is built in; wuj/grb/drb are optional (make build-full, or drop <code>.tsv/.ini into the corpora dir); a missing version renders "(not in <code>)". - --ui-lang: now any code (en, pl, ...), not just pl|en; note names/<code>.ini, ui/<code>.ini, custom calendars and the sanctorale override. - lectio-ui: drop the removed "bt" version and the no-op -o/--offline flag from the help (the tool is fully offline; --offline only ever dropped bt). - lectio-web: drop -o/--offline; add a one-line description of what it serves. No behaviour change; full suite green.
* caldata: allow an external universal sanctorale to override the embedded oneLukasz Kasprzak2026-07-281-0/+4
| | | | | | | | | | | | | | | | The universal calendar of saints can now be refreshed or replaced without a rebuild: if ~/.config/lectio/sanctorale/of.ini (OF) or ef.ini (EF) is present and parses, caldata.Base uses it instead of the embedded calendar; a missing or malformed file falls back to the embedded default, so the binary stays self-contained and correct out of the box. Local diocesan/national additions keep layering on top via calendars/ + `use` (unchanged). The temporal cycle and precedence rules stay in code -- only the sanctorale is data. - caldata.SetSanctoraleDir hook (mirrors bible/naming/i18n); Base() prefers the external file per form. config.SanctoraleDir(); wired in the CLI, TUI and web entry points. Tests cover override, no-file, and malformed-file fallback. - README: new "Calendar of saints" section (two tiers: overlay via `use`, replace via sanctorale/<form>.ini); config comment notes the override.
* i18n: make all UI chrome user-translatable via ui/<code>.iniLukasz Kasprzak2026-07-281-0/+3
| | | | | | | | | | | | | | | | | | | | The interface chrome (version labels, TUI keybar/messages, CLI banner words, web control labels, section-heading words) was English/Polish hardcoded in Go. It is now data: the English and Polish tables ship as embedded lang/en.ini and lang/pl.ini, and any language is user-overridable at <config>/ui/<code>.ini, resolved per key with an English fallback. With ui_language = <code> plus a names/<code>.ini, the WHOLE interface -- chrome, day names, saint names -- is translatable without a rebuild. - i18n.Get loads the embedded English baseline, overlays the embedded/user language file, caches per lang; field <-> INI-key mapping is by reflection (lang.go) so the tables and files stay in sync automatically. Edge-space values (e.g. "error: ") are double-quoted so the INI trim keeps them. The Go tables move to golden_test.go; TestGoldenMatchesEmbedded asserts the embedded files still parse back to them, and TestGenerateLangFiles regenerates them (LECTIO_GEN=1). - config.UIDir(); wire i18n.SetUserDir in the CLI, TUI and web entry points. - README/config: document ui/<code>.ini alongside names/<code>.ini.
* naming: localise liturgical day names in any languageLukasz Kasprzak2026-07-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add internal/naming, which renders temporal day names and celebration display names from the calendar engine's slugs in any language. English is the built-in baseline; a language is data -- an embedded lang/<code>.ini (pl shipped) and/or a user file at <config dir>/names/<code>.ini that overrides it key by key. Names compose from a small vocabulary plus per-language format templates, so word order and grammatical case can differ (e.g. Polish genitive "3. Niedziela Okresu Zwykłego"); any string a language omits falls back to English. - Move day-name generation out of calendar (calendar.HumanizeSlug removed, calendar stays a pure engine) into naming.DayName; the English golden cases carry over verbatim. - naming.CelebrationName unifies the three duplicated resolvers (cli/readings/calfeed): name.<lang> -> English -> Latin -> humanized slug. Saint names stay in the calendar data (name.<lang>), overridable via calendar layers. - config: ui_language now accepts any code (lower-cased, not clamped to en/pl) so names/<code>.ini applies; UI chrome still resolves en/pl and falls back to English. Add NamesDir(); wire naming.SetUserDir (and the previously unwired bible.SetUserCorporaDir) in the TUI and web mains too, so external corpora and name files work across all three binaries.
* refactor: remove the niedziela/missalemeum scrapers, bt, traditional_langLukasz Kasprzak2026-07-281-207/+55
| | | | | | | | | | | | | | | | | | | | | | The daily view now computes entirely offline (previous commit), so retire the network path and everything that served it: - Delete internal/tradlit (missalemeum) and the niedziela scraper from internal/liturgy (fetch/store/parse + fixtures); keep Section, DayInfo and ExtractCitation. - Remove the "bt" version everywhere (render gatherBT + branches, config, i18n, web form, TUI) and bible.ToEnglishRef (Polish citation converter). A legacy config carrying "bt" migrates to "wuj" on load (config.migrateBT). - Remove the traditional_lang config field and the -g/--lang flag from all three binaries. - Drop the now-dead flags -R/--refresh, -o/--offline, -u/--update, -C/--clean and the harvest/clean commands. - New defaults: versions = wuj,vul,grb,drb; default_version = vul. Update the README (offline-by-design, no harvest/update), help text, and stale niedziela/bt doc comments. Tests updated for the offline reality; go test ./... and go vet ./... are clean, all three binaries build and run offline (OF + EF, compare, web).
* feat(readings): compute the daily view offline (OF + EF)Lukasz Kasprzak2026-07-281-17/+11
| | | | | | | | | | | | | | | | | | Route readings.Load through the embedded calendar engine and lectionary data instead of the niedziela/missalemeum scrapers. The daily view now computes each day (calendar.Compute + caldata.Readings) and renders text from the public-domain corpora, with citations resolved per corpus. - bible.OFRef: normalise an English-canonical OF citation (drop sub-verse letters, ";" -> ",") and renumber Psalms for the target Psalter (Hebrew->Vulgate chapter for vul/grb/wuj; DRB title-fold verses for drb). - liturgy.Section gains Ref (English-canonical lookup ref) alongside Citation (sigla-dialect display); the loader fills both, resolveRef uses Ref, headings/citation command show Citation. - EffectiveVersions always drops "bt" (no offline corpus); the single daily version defaults to vernacularVersion (reading corpus else Latin). Scraper packages remain in the tree, unreferenced, pending removal.
* feat(cli): --format json|ical calendar emitters with range + validationLukasz Kasprzak2026-07-271-4/+38
|
* feat(cli): config-driven reading corpus + surface user corporaLukasz Kasprzak2026-07-271-2/+14
|
* feat(cli): lectio --corpus-check validatorLukasz Kasprzak2026-07-271-0/+10
|
* feat: books.toml -> books.ini, multi-language (add Latin dialect), ↵Lukasz Kasprzak2026-07-271-13/+3
| | | | | | | | | | config-scoped citation display books.ini with [en]/[pl]/[la]; parseBooks reads INI (bible drops go-toml). Latin dialect resolves EF citations (Eccli->Sirach, Apoc->Revelation, Luc...); sigla_style gains 'latin'. Reading citations now DISPLAY in the configured sigla (FormatRef(SiglaLang)), not raw English. One-shot books.toml->books.ini user migration (go-toml now config-only). Web settings editor -> books.ini.
* feat(cli): --cal-new scaffold + --cal-check lint for custom calendar layersLukasz Kasprzak2026-07-271-0/+11
| | | | Also: reject out-of-range MM-DD in resolveDate (strict validation for user data).
* chore: bump to 0.26.0 (offline OF calendar engine); document -L/--liturgyLukasz Kasprzak2026-07-271-0/+1
|
* feat(cli): 'lectio --liturgy/-L' prints the computed liturgical day offlineLukasz Kasprzak2026-07-271-0/+7
| | | | | Uses the pure engine + embedded universal calendar; UI-language names, rank, colour, cycles, and inline proper readings. Added the Assumption's propers.
* export: localize calendar title (month name via i18n Months + lectionary ↵Lukasz Kasprzak2026-07-241-1/+6
| | | | label); --ui-lang flag overrides interface/export language (cli + web ?lang=); v0.24.0
* export: month calendar PDF (A4 landscape, Monday-first grid, feast name + ↵Lukasz Kasprzak2026-07-241-2/+46
| | | | gospel ref + liturgical colour per day); cli --calendar YYYY-MM; web /calendar + link; readings.GospelCitation; v0.23.0
* export: internal/export (Markdown/Text/ReadingsPDF via pure-Go go-pdf/fpdf + ↵Lukasz Kasprzak2026-07-241-0/+62
| | | | embedded DejaVu Sans, covers pl/la/gr); cli --md/--pdf/--out; web /export + download links; v0.22.0
* cli: --rand -b accepts any version incl. bt (bt falls back to a corpus ↵Lukasz Kasprzak2026-07-241-15/+19
| | | | version instead of erroring); v0.16.1
* cli: --rand/--rand-v (random verse) + --rand-ch (random chapter) from the ↵Lukasz Kasprzak2026-07-241-3/+97
| | | | corpus, using the config default version; v0.16.0
* grb: strip SBLGNT apparatus markers (U+2E00–U+2E0D); render: show ↵Lukasz Kasprzak2026-07-241-1/+1
| | | | scripture ref in traditional headings; v0.12.0
* citation: render --citation/--week gospel ref in the configured sigla ↵Lukasz Kasprzak2026-07-241-12/+36
| | | | dialect (bible.FormatRef); v0.11.0
* qol: tui jump-to-date (d) + lectio --citation/--week + hide bt for ↵Lukasz Kasprzak2026-07-241-1/+93
| | | | traditional web; v0.10.0
* books: language-scoped --ref/--list via customizable books.toml + ↵Lukasz Kasprzak2026-07-241-36/+54
| | | | sigla_style config; v0.7.0
* bible-lookup: add --ref passage lookup + --list-pl/--list-en book lists; v0.6.0Lukasz Kasprzak2026-07-241-12/+166
|
* dayinfo: show feast/day name + colour (modern niedziela + traditional ↵Lukasz Kasprzak2026-07-241-3/+30
| | | | missalemeum) in cli/tui/web; v0.5.0
* rename the pl scripture version to bt (Biblia Tysiąclecia); v0.4.0Lukasz Kasprzak2026-07-241-8/+8
| | | | | | | | | | 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: keep real terminal width when paging; validate -c list before pagerLukasz Kasprzak2026-07-241-3/+19
|
* cli: pager for reading output (-P/--pager, --no-pager, config pager, $PAGER ↵Lukasz Kasprzak2026-07-241-9/+31
| | | | fallback); v0.3.0
* tradlit: offline caching + read; update pre-caches traditional; --clean ↵Lukasz Kasprzak2026-07-241-3/+48
| | | | prunes it; v0.2.0
* cli-ui,web: real flag parsing for lectio-ui/lectio-web (accept useful flags, ↵Lukasz Kasprzak2026-07-231-23/+11
| | | | reject unknown, -h/-v)
* tui: fix width-wrap garbling + straight-aligned verse column (export ↵Lukasz Kasprzak2026-07-231-3/+0
| | | | render.Wrap, hanging indent); strip niedziela summary subtitle (tui/cli/web); web verse grid alignment; refrain-italic pl-only
* cli,tui,web: share traditional+offline pl-drop via render.EffectiveVersions; ↵Lukasz Kasprzak2026-07-231-8/+16
| | | | -v/--version any position
* cli,liturgy: lectio --clean prunes readings cache older than one yearLukasz Kasprzak2026-07-231-1/+50
|
* i18n: fix consistency-review gaps in ui_language (en/pl chrome)Lukasz Kasprzak2026-07-231-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Closes six findings from review of the ui_language feature so English mode carries no leftover Polish UI text: - Web: interlinear "no verses" note and the empty-day error fragment now route through i18n instead of being unconditionally Polish. - render.GatherVersion/GatherVerses/resolveRef's four lookup/citation- failure blocks are now lang-aware (resolveRef gained a lang param). - i18n.ErrorPrefix/NoReadingsFor lost a stray extra trailing space, restoring the pre-i18n single-space TUI concatenation. - render.LocalizeHeading now matches a heading's actual leading label text against all known modern pl labels, rather than trusting the label keyed by sec.PartID -- fixes split-feast days where PartID is "drugie_czytanie" but the heading still reads "1. czytanie ...". - cli bannerFor is lang-specific again (pl "na", en "for"), restoring pl's exact pre-i18n wording instead of "--" for both languages. - index.html's <html lang> now follows cfg.UILanguage instead of being hardcoded "pl". gofmt/vet clean, go test ./... green, all three binaries build, no new go.mod deps. Consistency grep across cli/tui/web/render's live source turns up only two non-displayed identifiers (a PartID slug list and a pre-existing incipit-stripping constant on the pl scripture text itself).
* i18n: ui_language config (default en) for UI chrome across cli/tui/web; ↵Lukasz Kasprzak2026-07-231-13/+20
| | | | version labels localised
* cli: flag-driven interface (short+long); -u maximal blip-proof harvestLukasz Kasprzak2026-07-231-212/+162
| | | | | | | | | | | | | | Replace the today/date/show/compare/update subcommands with a single flag-driven interface like the Python predecessor: lectio [DATE] -a/-b/-c/-r/-w/-R/-o/-l/-g/-u, short and long names bound to the same variable, DATE (YYYY-MM-DD) extracted from any position in the args. Fix Harvest's "-u" to walk to the true maximal horizon without a transient network error being mistaken for it: a fetch failure now retries a few times with backoff and, if it still fails, is reported as an error (after saving partial progress via writeSigla), while a Parse failure (the real unpublished-horizon placeholder) still stops cleanly with a nil error.
* cli: subcommand dispatchLukasz Kasprzak2026-07-231-1/+471
|
* scaffold: module, mains, Makefile, embedded corporaLukasz Kasprzak2026-07-231-0/+12