Reference type added.

This encapsulates code/book, chapter, and verse.
This commit is contained in:
Benjamin A. Shelton 2026-10-08 22:46:24 -06:00
commit c70bcceeed
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01

View file

@ -68,6 +68,24 @@ func NewBible(root, translation string) (b *Bible, err error) {
return
}
type BibleRef struct {
Book string `json:"book"`
Chapter int `json:"chapter"`
Verse int `json:"verse,omitempty"`
Verses struct {
Start int `json:"start,omitempty"`
Stop int `json:"stop,omitempty"`
} `json:"verses"`
}
func (r *BibleRef) Code() string {
code, ok := FindAlias(r.Book)
if ok {
return strings.ToLower(code)
}
return ""
}
type Metadata struct {
ID string `json:"id"`
Name string `json:"name"`