Add JSON output format for programmatic access
Implements structured JSON output with hierarchical schema including book metadata, chapters, verses, and footnotes. All existing flags (-F, -g, -L) are respected in JSON mode.
This commit is contained in:
51
README.md
51
README.md
@@ -15,6 +15,7 @@ Code largely based off of [https://github.com/bontibon/kjv.git](https://github.c
|
||||
-F no footnotes
|
||||
-g show only German (no Latin)
|
||||
-L show only Latin (no German)
|
||||
-j output as JSON
|
||||
-h show help
|
||||
|
||||
Reference types:
|
||||
@@ -55,6 +56,56 @@ The text includes footnotes marked with Unicode superscript numbers (e.g., ¹,
|
||||
|
||||
- Use `-F` flag to disable footnote display if desired
|
||||
|
||||
### JSON Output
|
||||
|
||||
allioli supports structured JSON output for programmatic access to bible verses and footnotes. The JSON schema provides a hierarchical structure with book information, chapters, verses, and associated footnotes.
|
||||
|
||||
- Use `-j` flag to output in JSON format
|
||||
- All other flags (`-F`, `-g`, `-L`) are respected in JSON mode
|
||||
- The JSON structure follows this schema:
|
||||
|
||||
```json
|
||||
{
|
||||
"book": {
|
||||
"name": "Johannes",
|
||||
"abbreviation": "Joh",
|
||||
"number": 51
|
||||
},
|
||||
"chapter": 1,
|
||||
"verses": [
|
||||
{
|
||||
"verse": 1,
|
||||
"text": {
|
||||
"latin": "...",
|
||||
"german": "..."
|
||||
},
|
||||
"footnotes": [
|
||||
{
|
||||
"number": 1,
|
||||
"text": "..."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Examples:**
|
||||
|
||||
```bash
|
||||
# Get John 1:1 as JSON
|
||||
./allioli -j "Johannes 1:1"
|
||||
|
||||
# Get verses without footnotes
|
||||
./allioli -j -F "Johannes 1:1-3"
|
||||
|
||||
# Get only Latin text (with footnotes)
|
||||
./allioli -j -L "Johannes 1:1"
|
||||
|
||||
# Get only German text (with footnotes)
|
||||
./allioli -j -g "Johannes 1:1-5"
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
### From Source
|
||||
|
||||
Reference in New Issue
Block a user