aboutsummaryrefslogtreecommitdiff
path: root/internal/liturgy/section.go
blob: 485a45fe863906e3c8468f84c703ca1c4e5b742d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Package liturgy parses the daily Catholic liturgy readings page into
// structured sections (1st reading, psalm, acclamation, gospel).
package liturgy

// Section is one reading section of the liturgy (e.g. "1. czytanie", "Psalm",
// "Aklamacja", "Ewangelia"): its heading, optional subtitle, the citation shown
// to the reader, an English-canonical lookup reference, a stable identifier for
// which liturgical part it is, and its body split into paragraphs of text lines.
//
// Citation is the display form (the reader's configured sigla dialect); Ref is
// the English-canonical reference the render resolves against a corpus. Keeping
// them apart lets the header read "Ps 27" in Polish sigla while the lookup uses
// "Psalms 27" (renumbered per Psalter). Ref is empty for sources that only
// carry a display citation; the render then falls back to Citation.
type Section struct {
	Heading, Subtitle, Citation, Ref, PartID string
	Paragraphs                               [][]string
}

// DayInfo is the day's liturgical identity from the offline calendar engine.
// Name follows the UI language where the calendar data has a localized name
// (else English); Colour is normalized. A day that carries no celebration name
// yields a zero DayInfo; callers must treat that as "omit the header", never as
// an error.
type DayInfo struct {
	// Name is the celebration, e.g. "św. Marii Magdaleny" (pl UI, where the
	// calendar data has a Polish name) or "Saint Mary Magdalene" (en).
	Name string
	// Season is the temporal context; currently left empty by the offline
	// loader, since the celebration name already carries the temporal identity
	// on temporal days.
	Season string
	// Colour is the normalized liturgical colour: "white", "green",
	// "violet", "red", "rose", or "" when unknown/unmapped.
	Colour string
	// Rank is the normalized liturgical rank of the observed celebration:
	// the Ordinary Form's "ferial", "optional", "memorial", "feast",
	// "solemnity", or the 1962 form's "class-1".."class-4",
	// "commemoration". Empty when the day carries no rank.
	Rank string
}