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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*!
logoxide: Bibles, commentaries, lexicons, books, and media as versioned packages.
A package is a git repository (or a registry's archive) with a `logoxide.toml` ([`manifest`]) and
its text in one or more formats. Bibles are read as verses from USX, USFM (through `usfm3`), USJ,
OSIS, and ThML (by the `logoxide-text` crate, behind the `read` feature: a book a file, or a whole Bible
in one file); books are kept as EPUBs, whose Bible references topos finds ([`references`]);
versification maps are Paratext `.vrs` lines (logoxide-text's `versification`); audio and video
are listed by URL and hash, never stored ([`media`]).
- [`Package::open`] reads a package from any [`Storage`] (a folder, memory, or a host's files in
WebAssembly), choosing the best readable format its features turn on; [`Cache`] keeps its
parsed books, and [`CachedPackage::add_to`] gives topos the translation's name, aliases, and
verse counts, so `John 3:16 KJV` is checked against that translation
- [`Project`] is a folder with a `logoxide.toml` (a vault's has no `[package]`) and its
`logoxide.lock` ([`lock`]): [`Project::install`] resolves its dependencies (git, registry
archives, or paths) into the [`Library`], pinned by commit and checksum
- [`catalog`] searches catalogs (`catalog.toml`; other publishers' lists, read by the
`logoxide-import` crate, which turns their downloads into packages)
- [`summary`] says what a version holds (verse counts, a hash of every verse) and how much a new
version changed, which [`release`] checks against its version number
```no_run
use std::sync::Arc;
use logoxide::{
Cache, Features, FsStorage, Package, reader::DefaultReader,
topos_bible::data::translations::Translations,
};
fn main() -> logoxide::Result<()> {
// A package's folder: its logoxide.toml and its text
let package = Package::open(Arc::new(FsStorage::new("bibles/kjv")), Features::default())?;
let info = package.info();
println!("{} {}: {}", info.short_name(), info.version, package.checksum()?);
// Parsed books and verse counts are kept in a cache folder, by version and checksum
let cache = Cache::new(Arc::new(FsStorage::new("cache")));
let kjv = cache.open(package, &DefaultReader)?;
if let Some(john) = logoxide::bible_data().books().search_usfm("JHN") {
println!("John has {} chapters", kjv.book(john)?.chapter_verses().len());
}
// topos checks references naming the translation against its own verse counts
let _translations = kjv.add_to(Translations::default());
Ok(())
}
```
A vault's Bibles, installed as its lock file says (fetching runs the `git` command):
```no_run
use logoxide::{Library, Project, git::GitCli, reader::DefaultReader, resolve::Update};
fn main() -> logoxide::Result<()> {
let mut project = Project::open("notes")?;
let library = Library::new("library", "cache");
project.install(&library, &GitCli::default(), Update::Nothing)?;
let _translations = project.translations(&library, &DefaultReader)?;
Ok(())
}
```
The file formats (`logoxide.toml`, `catalog.toml`, `logoxide.lock`, summaries) and the trust
model are specified in the repository's `doc/` folder, for other implementations.
*/
use LazyLock;
pub use ;
pub use ;
pub use Library;
pub use ;
pub use Manifest;
pub use ;
pub use Project;
pub use TextReader;
pub use ;
pub use topos_bible;
use BibleData;
static BIBLE_DATA: = new;
/// topos's book names and versification, with the deuterocanon, so every book a translation can
/// have is known