From 7b220084cf3951c8cde0582efdfcf628afc64336 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 28 Jul 2026 12:50:31 +0200 Subject: refactor: remove the niedziela/missalemeum scrapers, bt, traditional_lang 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). --- internal/export/export_test.go | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'internal/export/export_test.go') diff --git a/internal/export/export_test.go b/internal/export/export_test.go index 7f1c68d..5adf7d4 100644 --- a/internal/export/export_test.go +++ b/internal/export/export_test.go @@ -8,30 +8,37 @@ import ( "github.com/lukaszkasprzak/lectio/internal/liturgy" ) +// sampleSecs builds a reading section the offline way: the English-canonical +// lookup reference lives in Ref, the display citation stays in the reader's +// sigla dialect. render.GatherVersion resolves Ref against a real embedded +// corpus, so the exported document carries actual verse text. func sampleSecs() []liturgy.Section { return []liturgy.Section{{ - Heading: "Ewangelia (Mt 13, 1-9)", - Citation: "Mt 13, 1-9", - PartID: "ewangelia", - Paragraphs: [][]string{{"Owego dnia Jezus wyszedł z domu i usiadł nad jeziorem."}}, + Heading: "Ewangelia", + Citation: "J 20, 1. 11-18", + Ref: "John 20:1,11-18", + PartID: "ewangelia", }} } func TestMarkdownAndText(t *testing.T) { info := liturgy.DayInfo{Name: "Środa XV tygodnia", Colour: "green"} - md := Markdown("2026-07-22", info, sampleSecs(), "bt", "new", "en") - if !strings.Contains(md, "# Środa") || !strings.Contains(md, "## Gospel") || !strings.Contains(md, "Jezus wyszedł") { + // vul -> Vulgate Latin verse text, versified ("20:1 Una autem sabbati, + // Maria Magdalene ..."). + md := Markdown("2026-07-22", info, sampleSecs(), "vul", "new", "en") + if !strings.Contains(md, "# Środa") || !strings.Contains(md, "## Gospel") || + !strings.Contains(md, "20:1") || !strings.Contains(md, "Maria Magdalene") { t.Errorf("markdown:\n%s", md) } - txt := Text("2026-07-22", info, sampleSecs(), "bt", "new", "en") - if !strings.Contains(txt, "Jezus wyszedł") || !strings.Contains(txt, "Gospel") { + txt := Text("2026-07-22", info, sampleSecs(), "vul", "new", "en") + if !strings.Contains(txt, "Maria Magdalene") || !strings.Contains(txt, "Gospel") { t.Errorf("text:\n%s", txt) } } func TestReadingsPDF(t *testing.T) { info := liturgy.DayInfo{Name: "Środa XV tygodnia"} - pdf, err := ReadingsPDF("2026-07-22", info, sampleSecs(), "bt", "new", "en") + pdf, err := ReadingsPDF("2026-07-22", info, sampleSecs(), "vul", "new", "en") if err != nil { t.Fatal(err) } -- cgit v1.3