aboutsummaryrefslogtreecommitdiff
path: root/internal/caldata/caldata.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-27 23:27:07 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-27 23:27:07 +0200
commit4a35093c4358be17da6f0f374197caed743bda26 (patch)
treed0b4298cae6738632437923a64fda0463efbe658 /internal/caldata/caldata.go
parent5d765444f315ee512c5ceb9bcf83730be8112b60 (diff)
downloadlectio-4a35093c4358be17da6f0f374197caed743bda26.tar.gz
lectio-4a35093c4358be17da6f0f374197caed743bda26.zip
feat(caldata): OF Sunday/solemnity readings by slug+cycle (seed table)
Diffstat (limited to 'internal/caldata/caldata.go')
-rw-r--r--internal/caldata/caldata.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/caldata/caldata.go b/internal/caldata/caldata.go
index 92f9327..9c17035 100644
--- a/internal/caldata/caldata.go
+++ b/internal/caldata/caldata.go
@@ -25,6 +25,12 @@ var tridentineLectionary []byte
// efTempReadings maps an EF temporal-day slug to its readings (parsed once).
var efTempReadings = parseLectionary(tridentineLectionary)
+//go:embed of-lectionary.ini
+var ofLectionary []byte
+
+// ofTempReadings maps an OF <slug>-<cycle> key to its readings (parsed once).
+var ofTempReadings = parseLectionary(ofLectionary)
+
func parseLectionary(data []byte) map[string][]calendar.Reading {
l, err := ParseLayer(data)
if err != nil {
@@ -44,12 +50,12 @@ func parseLectionary(data []byte) map[string][]calendar.Reading {
}
// TemporalReadings returns the temporal-cycle readings for a computed day slug,
-// or nil. Only the EF ("old") temporal lectionary exists so far.
+// or nil. EF ("old") looks up efTempReadings; OF looks up ofTempReadings.
func TemporalReadings(form, slug string) []calendar.Reading {
if form == "old" {
return efTempReadings[slug]
}
- return nil
+ return ofTempReadings[slug]
}
// Universal parses the embedded Ordinary Form universal calendar. It panics on a