Reference type added.
This encapsulates code/book, chapter, and verse.
This commit is contained in:
parent
0d7203884e
commit
c70bcceeed
1 changed files with 18 additions and 0 deletions
|
|
@ -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"`
|
||||
|
|
|
|||
Loading…
Reference in a new issue