aboutsummaryrefslogtreecommitdiff
path: root/internal/caldata/caldata.go
diff options
context:
space:
mode:
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