diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-24 15:25:50 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-24 15:25:50 +0200 |
| commit | ed7717fef53db3b3aa5593fbb2649313e75a0f31 (patch) | |
| tree | 023601285808a4704f5646bf6e4777beea6dd93a /internal/bible/bible.go | |
| parent | 1e4939874a14d8abb13e82b2273bfc5f9d653295 (diff) | |
| download | lectio-ed7717fef53db3b3aa5593fbb2649313e75a0f31.tar.gz lectio-ed7717fef53db3b3aa5593fbb2649313e75a0f31.zip | |
cli: --rand/--rand-v (random verse) + --rand-ch (random chapter) from the corpus, using the config default version; v0.16.0
Diffstat (limited to 'internal/bible/bible.go')
| -rw-r--r-- | internal/bible/bible.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/bible/bible.go b/internal/bible/bible.go index 312daeb..1603188 100644 --- a/internal/bible/bible.go +++ b/internal/bible/bible.go @@ -71,3 +71,15 @@ func Chapters(version, book string) []int { sort.Ints(chaps) return chaps } + +// CorpusBooks returns the book names present in a version's corpus, sorted +// (empty for a version with no embedded corpus, e.g. "bt"). +func CorpusBooks(version string) []string { + c := load(version) + books := make([]string, 0, len(c.books)) + for b := range c.books { + books = append(books, b) + } + sort.Strings(books) + return books +} |
