aboutsummaryrefslogtreecommitdiff
path: root/internal/bible/books.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/bible/books.go')
-rw-r--r--internal/bible/books.go45
1 files changed, 45 insertions, 0 deletions
diff --git a/internal/bible/books.go b/internal/bible/books.go
index 045509a..f3af4af 100644
--- a/internal/bible/books.go
+++ b/internal/bible/books.go
@@ -112,3 +112,48 @@ func ResolveBook(query string) (string, bool) {
}
return "", false
}
+
+// canonOrder lists every aliasSeed book in scriptural (Catholic canon) order:
+// 46 Old Testament books then 27 New Testament. It is the ONLY hand-maintained
+// ordering; the display names are still derived from aliasSeed so there is one
+// source of truth for spellings. A test asserts canonOrder and aliasSeed hold
+// exactly the same set.
+var canonOrder = []string{
+ // Old Testament
+ "Genesis", "Exodus", "Leviticus", "Numbers", "Deuteronomy",
+ "Joshua", "Judges", "Ruth", "1 Samuel", "2 Samuel",
+ "1 Kings", "2 Kings", "1 Chronicles", "2 Chronicles", "Ezra",
+ "Nehemiah", "Tobit", "Judith", "Esther", "1 Maccabees",
+ "2 Maccabees", "Job", "Psalms", "Proverbs", "Ecclesiastes",
+ "Song of Solomon", "Wisdom", "Sirach", "Isaiah", "Jeremiah",
+ "Lamentations", "Baruch", "Ezekiel", "Daniel", "Hosea",
+ "Joel", "Amos", "Obadiah", "Jonah", "Micah",
+ "Nahum", "Habakkuk", "Zephaniah", "Haggai", "Zechariah",
+ "Malachi",
+ // New Testament
+ "Matthew", "Mark", "Luke", "John", "The Acts",
+ "Romans", "1 Corinthians", "2 Corinthians", "Galatians", "Ephesians",
+ "Philippians", "Colossians", "1 Thessalonians", "2 Thessalonians", "1 Timothy",
+ "2 Timothy", "Titus", "Philemon", "Hebrews", "James",
+ "1 Peter", "2 Peter", "1 John", "2 John", "3 John",
+ "Jude", "Revelation",
+}
+
+// BookInfo is one Biblical book's display data for the --list-pl/--list-en
+// commands (and, in later phases, the reader book pickers).
+type BookInfo struct {
+ English string // canonical English name, e.g. "John" (the aliasSeed key)
+ Polish string // Polish name, e.g. "Jan" (aliasSeed value [1])
+ Abbrev string // Polish citation abbreviation, e.g. "J" (aliasSeed value [0])
+}
+
+// Books returns every Biblical book in scriptural order with its English name,
+// Polish name and citation abbreviation, all derived from aliasSeed.
+func Books() []BookInfo {
+ out := make([]BookInfo, 0, len(canonOrder))
+ for _, name := range canonOrder {
+ a := aliasSeed[name]
+ out = append(out, BookInfo{English: name, Polish: a[1], Abbrev: a[0]})
+ }
+ return out
+}