aboutsummaryrefslogtreecommitdiff
path: root/internal/liturgy/section.go
blob: cacefb0d68ae00e7d6f76bd3bd5cb00623710e23 (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
// 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 page (e.g. "1. czytanie",
// "Psalm", "Aklamacja", "Ewangelia"): its heading, optional subtitle, the
// citation extracted from the heading, a stable identifier for which liturgical
// part it is, and its body split into paragraphs of text lines.
type Section struct {
	Heading, Subtitle, Citation, PartID string
	Paragraphs                          [][]string
}

// DayInfo is the day's liturgical identity, source-language (Polish for the
// modern niedziela.pl lectionary, English/Latin for the traditional
// missalemeum) -- never translated, like Section's own Heading/Citation.
// A source that carries no such data (or an unrecognised page/response
// shape) 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. "Święto św. Marii Magdaleny" (modern) or
	// "St. Mary Magdalene" (traditional).
	Name string
	// Season is the temporal context, e.g. "Feria IV after VIII Sunday
	// after Pentecost" (traditional); always "" for the modern lectionary,
	// whose temporal is folded into Name on temporal days.
	Season string
	// Colour is the normalized liturgical colour: "white", "green",
	// "violet", "red", "rose", or "" when unknown/unmapped.
	Colour string
}