Sync LibreBible public catalog snapshot

This commit is contained in:
2026-07-12 07:01:15 -05:00
parent edbce26cd3
commit b5332205e7
7 changed files with 636 additions and 19 deletions
+5
View File
@@ -1,5 +1,10 @@
# Changelog # Changelog
## 0.1.1 - 2026-07-12
- Synced the public LibreBible catalog snapshot after Phase 6 CrossWire/SWORD imports.
- Updated the `/librebible/` page to display translations and study helps without assuming every resource is a Bible translation.
## 0.1.0 - 2026-07-12 ## 0.1.0 - 2026-07-12
- Phase 5 ChristIT.com catalog: added a public `/librebible/` page that reads a generated LibreBible catalog JSON snapshot and displays available Bible resources. - Phase 5 ChristIT.com catalog: added a public `/librebible/` page that reads a generated LibreBible catalog JSON snapshot and displays available Bible resources.
+1 -1
View File
@@ -1 +1 @@
0.1.0 0.1.1
+257 -1
View File
@@ -1,7 +1,7 @@
{ {
"schema_version": "librebible.index-catalog.v1", "schema_version": "librebible.index-catalog.v1",
"project": "LibreBible", "project": "LibreBible",
"generated_at": "2026-07-12T03:10:02.881Z", "generated_at": "2026-07-12T04:31:19.179Z",
"resources": [ "resources": [
{ {
"id": "kjv-eng-kjv2006", "id": "kjv-eng-kjv2006",
@@ -180,6 +180,262 @@
"expected_sha256": "4ea6952590d070bfa22985aded48a49581e31b568a60aa09e25f73462e700e7d", "expected_sha256": "4ea6952590d070bfa22985aded48a49581e31b568a60aa09e25f73462e700e7d",
"last_checked_at": "2026-07-12T02:18:30Z" "last_checked_at": "2026-07-12T02:18:30Z"
} }
},
{
"id": "sword-jfb",
"resource_type": "commentary",
"title": "Jamieson Fausset Brown Bible Commentary",
"short_title": "Jamieson Fausset Brown Bible Commentary",
"abbreviation": "JFB",
"alternate_ids": [
"JFB"
],
"language": {
"code": "en",
"name": "English"
},
"script": "Latn",
"canon": {
"scope": "KJV",
"notes": "Commentary entries are keyed to SWORD Bible references."
},
"contributors": [
{
"name": "Robert Jamieson, A. R. Fausset, and David Brown",
"role": "commentary authors"
},
{
"name": "CrossWire Bible Society",
"role": "module provider"
}
],
"features": [
{
"id": "commentary-entries",
"type": "commentary",
"label": "Commentary entries",
"languages": [
"eng"
],
"embedded": true,
"package": "packages/json/sword-jfb/commentary.jsonl"
},
{
"id": "sword-source",
"type": "source_format",
"label": "SWORD source",
"format": "OSIS",
"embedded": false
}
],
"attachments": {
"included": [
{
"id": "sword-jfb-commentary",
"resource_type": "commentary",
"label": "Commentary entries",
"relationship": "range-to-commentary",
"anchor_types": [
"book",
"chapter",
"verse",
"verse_range"
],
"languages": [
"eng"
],
"source": "CrossWire SWORD module export.",
"package": "packages/json/sword-jfb/commentary.jsonl"
}
]
},
"source": {
"provider": "CrossWire Bible Society",
"url": "https://crosswire.org/sword/modules/ModInfo.jsp?modName=JFB",
"download_url": "https://crosswire.org/ftpmirror/pub/sword/packages/rawzip/JFB.zip",
"format": "sword-rawzip",
"upstream_id": "JFB",
"upstream_last_updated": "2021-02-15",
"sword": {
"module_id": "JFB",
"conf_file": "mods.d/jfb.conf",
"mod_drv": "zCom4",
"source_type": "OSIS",
"versification": "KJV",
"version": "3.0",
"data_path": "./modules/comments/zcom/jfb/",
"text_source": "https://ccel.org/ccel/j/jamieson/jfb/cache/jfb.txt"
}
},
"license": {
"name": "Public Domain",
"redistribution": true,
"commercial_use": true,
"share_alike": false,
"source_license_url": "https://crosswire.org/ftpmirror/pub/sword/raw/mods.d/jfb.conf",
"attribution": "Jamieson Fausset Brown Bible Commentary Text source: https://ccel.org/ccel/j/jamieson/jfb/cache/jfb.txt SWORD module: JFB Provided by CrossWire Bible Society.",
"jurisdiction_notes": "No jurisdiction-specific restriction was found in the SWORD module metadata.",
"restricted_notes": "Public-domain resources may be normalized and redistributed when the upstream module metadata has no extra restriction."
},
"catalog_display": {
"primary_features": [
"Commentary entries",
"Verse/range anchors",
"SWORD source"
],
"summary": "Jamieson Fausset Brown Bible Commentary, imported from the CrossWire JFB SWORD module with 16945 commentary entries."
},
"package_path": "packages/json/sword-jfb/catalog.json",
"source_manifest_path": "sources/sword-jfb.json",
"detail_doc_path": "docs/resources/sword-jfb.md",
"counts": {
"entries": 16945,
"commentary_entries": 16945
},
"files": {
"commentary_jsonl": {
"path": "commentary.jsonl",
"bytes": 32753867,
"sha256": "bf9e2cd40159e0e83f261652b2d4874d9450131575dc6c73d07dc568433a47d9"
},
"source_rawzip": {
"path": "JFB.zip",
"bytes": 5687741,
"sha256": "a0b44ee84687cf0d8300ea4543cd375be42ab804902e72e448ea5f7d1c60b1bf"
}
},
"checks": {
"expected_sha256": "a0b44ee84687cf0d8300ea4543cd375be42ab804902e72e448ea5f7d1c60b1bf",
"last_checked_at": "2026-07-12T04:31:19.021Z"
}
},
{
"id": "sword-mhcc",
"resource_type": "commentary",
"title": "Matthew Henry's Concise Commentary on the Whole Bible",
"short_title": "Matthew Henry's Concise Commentary on the Whole Bible",
"abbreviation": "MHCC",
"alternate_ids": [
"MHCC"
],
"language": {
"code": "en",
"name": "English"
},
"script": "Latn",
"canon": {
"scope": "KJV",
"notes": "Commentary entries are keyed to SWORD Bible references."
},
"contributors": [
{
"name": "Matthew Henry",
"role": "commentary author"
},
{
"name": "CrossWire Bible Society",
"role": "module provider"
}
],
"features": [
{
"id": "commentary-entries",
"type": "commentary",
"label": "Commentary entries",
"languages": [
"eng"
],
"embedded": true,
"package": "packages/json/sword-mhcc/commentary.jsonl"
},
{
"id": "sword-source",
"type": "source_format",
"label": "SWORD source",
"format": "OSIS",
"embedded": false
}
],
"attachments": {
"included": [
{
"id": "sword-mhcc-commentary",
"resource_type": "commentary",
"label": "Commentary entries",
"relationship": "range-to-commentary",
"anchor_types": [
"book",
"chapter",
"verse",
"verse_range"
],
"languages": [
"eng"
],
"source": "CrossWire SWORD module export.",
"package": "packages/json/sword-mhcc/commentary.jsonl"
}
]
},
"source": {
"provider": "CrossWire Bible Society",
"url": "https://crosswire.org/sword/modules/ModInfo.jsp?modName=MHCC",
"download_url": "https://crosswire.org/ftpmirror/pub/sword/packages/rawzip/MHCC.zip",
"format": "sword-rawzip",
"upstream_id": "MHCC",
"upstream_last_updated": "2021-02-14",
"sword": {
"module_id": "MHCC",
"conf_file": "mods.d/mhcc.conf",
"mod_drv": "zCom",
"source_type": "OSIS",
"versification": "KJV",
"version": "2.0",
"data_path": "./modules/comments/zcom/mhcc/",
"text_source": "https://ccel.org/ccel/h/henry/mhcc/cache/mhcc.txt"
}
},
"license": {
"name": "Public Domain",
"redistribution": true,
"commercial_use": true,
"share_alike": false,
"source_license_url": "https://crosswire.org/ftpmirror/pub/sword/raw/mods.d/mhcc.conf",
"attribution": "Matthew Henry's Concise Commentary on the Whole Bible Text source: https://ccel.org/ccel/h/henry/mhcc/cache/mhcc.txt SWORD module: MHCC Provided by CrossWire Bible Society.",
"jurisdiction_notes": "No jurisdiction-specific restriction was found in the SWORD module metadata.",
"restricted_notes": "Public-domain resources may be normalized and redistributed when the upstream module metadata has no extra restriction."
},
"catalog_display": {
"primary_features": [
"Commentary entries",
"Verse/range anchors",
"SWORD source"
],
"summary": "Matthew Henry's Concise Commentary on the Whole Bible, imported from the CrossWire MHCC SWORD module with 4059 commentary entries."
},
"package_path": "packages/json/sword-mhcc/catalog.json",
"source_manifest_path": "sources/sword-mhcc.json",
"detail_doc_path": "docs/resources/sword-mhcc.md",
"counts": {
"entries": 4059,
"commentary_entries": 4059
},
"files": {
"commentary_jsonl": {
"path": "commentary.jsonl",
"bytes": 10830202,
"sha256": "a7765c9fcf9b72174606623d424ff8d6e08f3cfc18fe3c62e0d38fdf73d8a6ad"
},
"source_rawzip": {
"path": "MHCC.zip",
"bytes": 1773039,
"sha256": "fc21726d9f5621c6168ed173442df2a973acad8d1d210ac1fa6c7ead7d3c5f30"
}
},
"checks": {
"expected_sha256": "fc21726d9f5621c6168ed173442df2a973acad8d1d210ac1fa6c7ead7d3c5f30",
"last_checked_at": "2026-07-12T04:31:19.179Z"
}
} }
] ]
} }
@@ -157,7 +157,7 @@
"name": "scripts/import-usfm.js", "name": "scripts/import-usfm.js",
"version": "0.1.0" "version": "0.1.0"
}, },
"generated_at": "2026-07-12T03:10:02.881Z", "generated_at": "2026-07-12T04:31:17.237Z",
"source_sha256": "4ea6952590d070bfa22985aded48a49581e31b568a60aa09e25f73462e700e7d", "source_sha256": "4ea6952590d070bfa22985aded48a49581e31b568a60aa09e25f73462e700e7d",
"checks": { "checks": {
"expected_sha256": "4ea6952590d070bfa22985aded48a49581e31b568a60aa09e25f73462e700e7d", "expected_sha256": "4ea6952590d070bfa22985aded48a49581e31b568a60aa09e25f73462e700e7d",
+146
View File
@@ -0,0 +1,146 @@
{
"schema_version": "librebible.resource-catalog.v1",
"project": "LibreBible",
"id": "sword-jfb",
"source_manifest_file": "sword-jfb.json",
"resource_type": "commentary",
"title": "Jamieson Fausset Brown Bible Commentary",
"short_title": "Jamieson Fausset Brown Bible Commentary",
"abbreviation": "JFB",
"alternate_ids": [
"JFB"
],
"language": {
"code": "en",
"name": "English"
},
"script": "Latn",
"canon": {
"scope": "KJV",
"notes": "Commentary entries are keyed to SWORD Bible references."
},
"contributors": [
{
"name": "Robert Jamieson, A. R. Fausset, and David Brown",
"role": "commentary authors"
},
{
"name": "CrossWire Bible Society",
"role": "module provider"
}
],
"features": [
{
"id": "commentary-entries",
"type": "commentary",
"label": "Commentary entries",
"languages": [
"eng"
],
"embedded": true,
"package": "packages/json/sword-jfb/commentary.jsonl"
},
{
"id": "sword-source",
"type": "source_format",
"label": "SWORD source",
"format": "OSIS",
"embedded": false
}
],
"attachments": {
"included": [
{
"id": "sword-jfb-commentary",
"resource_type": "commentary",
"label": "Commentary entries",
"relationship": "range-to-commentary",
"anchor_types": [
"book",
"chapter",
"verse",
"verse_range"
],
"languages": [
"eng"
],
"source": "CrossWire SWORD module export.",
"package": "packages/json/sword-jfb/commentary.jsonl"
}
]
},
"source": {
"provider": "CrossWire Bible Society",
"url": "https://crosswire.org/sword/modules/ModInfo.jsp?modName=JFB",
"download_url": "https://crosswire.org/ftpmirror/pub/sword/packages/rawzip/JFB.zip",
"format": "sword-rawzip",
"upstream_id": "JFB",
"upstream_last_updated": "2021-02-15",
"sword": {
"module_id": "JFB",
"conf_file": "mods.d/jfb.conf",
"mod_drv": "zCom4",
"source_type": "OSIS",
"versification": "KJV",
"version": "3.0",
"data_path": "./modules/comments/zcom/jfb/",
"text_source": "https://ccel.org/ccel/j/jamieson/jfb/cache/jfb.txt"
}
},
"license": {
"name": "Public Domain",
"redistribution": true,
"commercial_use": true,
"share_alike": false,
"source_license_url": "https://crosswire.org/ftpmirror/pub/sword/raw/mods.d/jfb.conf",
"attribution": "Jamieson Fausset Brown Bible Commentary Text source: https://ccel.org/ccel/j/jamieson/jfb/cache/jfb.txt SWORD module: JFB Provided by CrossWire Bible Society.",
"jurisdiction_notes": "No jurisdiction-specific restriction was found in the SWORD module metadata.",
"restricted_notes": "Public-domain resources may be normalized and redistributed when the upstream module metadata has no extra restriction."
},
"catalog_display": {
"primary_features": [
"Commentary entries",
"Verse/range anchors",
"SWORD source"
],
"summary": "Jamieson Fausset Brown Bible Commentary, imported from the CrossWire JFB SWORD module with 16945 commentary entries."
},
"importer": {
"name": "scripts/import-sword.js",
"version": "0.1.0",
"engine": "CrossWire SWORD mod2imp via Docker/Ubuntu libsword-utils"
},
"generated_at": "2026-07-12T04:31:19.022Z",
"source_sha256": "a0b44ee84687cf0d8300ea4543cd375be42ab804902e72e448ea5f7d1c60b1bf",
"checks": {
"expected_sha256": "a0b44ee84687cf0d8300ea4543cd375be42ab804902e72e448ea5f7d1c60b1bf",
"last_checked_at": "2026-07-12T04:31:19.021Z"
},
"counts": {
"entries": 16945,
"commentary_entries": 16945
},
"files": {
"commentary_jsonl": {
"path": "commentary.jsonl",
"bytes": 32753867,
"sha256": "bf9e2cd40159e0e83f261652b2d4874d9450131575dc6c73d07dc568433a47d9"
},
"source_rawzip": {
"path": "JFB.zip",
"bytes": 5687741,
"sha256": "a0b44ee84687cf0d8300ea4543cd375be42ab804902e72e448ea5f7d1c60b1bf"
}
},
"sword": {
"module_id": "JFB",
"conf_file": "mods.d/jfb.conf",
"mod_drv": "zCom4",
"source_type": "OSIS",
"versification": "KJV",
"version": "3.0",
"data_path": "./modules/comments/zcom/jfb/",
"text_source": "https://ccel.org/ccel/j/jamieson/jfb/cache/jfb.txt"
},
"raw_conf_sha256": "8d494870d68cd92203441dc2dd264ba273087388b70d84b703782de346ef3f6f"
}
+146
View File
@@ -0,0 +1,146 @@
{
"schema_version": "librebible.resource-catalog.v1",
"project": "LibreBible",
"id": "sword-mhcc",
"source_manifest_file": "sword-mhcc.json",
"resource_type": "commentary",
"title": "Matthew Henry's Concise Commentary on the Whole Bible",
"short_title": "Matthew Henry's Concise Commentary on the Whole Bible",
"abbreviation": "MHCC",
"alternate_ids": [
"MHCC"
],
"language": {
"code": "en",
"name": "English"
},
"script": "Latn",
"canon": {
"scope": "KJV",
"notes": "Commentary entries are keyed to SWORD Bible references."
},
"contributors": [
{
"name": "Matthew Henry",
"role": "commentary author"
},
{
"name": "CrossWire Bible Society",
"role": "module provider"
}
],
"features": [
{
"id": "commentary-entries",
"type": "commentary",
"label": "Commentary entries",
"languages": [
"eng"
],
"embedded": true,
"package": "packages/json/sword-mhcc/commentary.jsonl"
},
{
"id": "sword-source",
"type": "source_format",
"label": "SWORD source",
"format": "OSIS",
"embedded": false
}
],
"attachments": {
"included": [
{
"id": "sword-mhcc-commentary",
"resource_type": "commentary",
"label": "Commentary entries",
"relationship": "range-to-commentary",
"anchor_types": [
"book",
"chapter",
"verse",
"verse_range"
],
"languages": [
"eng"
],
"source": "CrossWire SWORD module export.",
"package": "packages/json/sword-mhcc/commentary.jsonl"
}
]
},
"source": {
"provider": "CrossWire Bible Society",
"url": "https://crosswire.org/sword/modules/ModInfo.jsp?modName=MHCC",
"download_url": "https://crosswire.org/ftpmirror/pub/sword/packages/rawzip/MHCC.zip",
"format": "sword-rawzip",
"upstream_id": "MHCC",
"upstream_last_updated": "2021-02-14",
"sword": {
"module_id": "MHCC",
"conf_file": "mods.d/mhcc.conf",
"mod_drv": "zCom",
"source_type": "OSIS",
"versification": "KJV",
"version": "2.0",
"data_path": "./modules/comments/zcom/mhcc/",
"text_source": "https://ccel.org/ccel/h/henry/mhcc/cache/mhcc.txt"
}
},
"license": {
"name": "Public Domain",
"redistribution": true,
"commercial_use": true,
"share_alike": false,
"source_license_url": "https://crosswire.org/ftpmirror/pub/sword/raw/mods.d/mhcc.conf",
"attribution": "Matthew Henry's Concise Commentary on the Whole Bible Text source: https://ccel.org/ccel/h/henry/mhcc/cache/mhcc.txt SWORD module: MHCC Provided by CrossWire Bible Society.",
"jurisdiction_notes": "No jurisdiction-specific restriction was found in the SWORD module metadata.",
"restricted_notes": "Public-domain resources may be normalized and redistributed when the upstream module metadata has no extra restriction."
},
"catalog_display": {
"primary_features": [
"Commentary entries",
"Verse/range anchors",
"SWORD source"
],
"summary": "Matthew Henry's Concise Commentary on the Whole Bible, imported from the CrossWire MHCC SWORD module with 4059 commentary entries."
},
"importer": {
"name": "scripts/import-sword.js",
"version": "0.1.0",
"engine": "CrossWire SWORD mod2imp via Docker/Ubuntu libsword-utils"
},
"generated_at": "2026-07-12T04:31:19.179Z",
"source_sha256": "fc21726d9f5621c6168ed173442df2a973acad8d1d210ac1fa6c7ead7d3c5f30",
"checks": {
"expected_sha256": "fc21726d9f5621c6168ed173442df2a973acad8d1d210ac1fa6c7ead7d3c5f30",
"last_checked_at": "2026-07-12T04:31:19.179Z"
},
"counts": {
"entries": 4059,
"commentary_entries": 4059
},
"files": {
"commentary_jsonl": {
"path": "commentary.jsonl",
"bytes": 10830202,
"sha256": "a7765c9fcf9b72174606623d424ff8d6e08f3cfc18fe3c62e0d38fdf73d8a6ad"
},
"source_rawzip": {
"path": "MHCC.zip",
"bytes": 1773039,
"sha256": "fc21726d9f5621c6168ed173442df2a973acad8d1d210ac1fa6c7ead7d3c5f30"
}
},
"sword": {
"module_id": "MHCC",
"conf_file": "mods.d/mhcc.conf",
"mod_drv": "zCom",
"source_type": "OSIS",
"versification": "KJV",
"version": "2.0",
"data_path": "./modules/comments/zcom/mhcc/",
"text_source": "https://ccel.org/ccel/h/henry/mhcc/cache/mhcc.txt"
},
"raw_conf_sha256": "78d3df89bc6343d67e37a37b106904135a01e3ce15f2a157f9c090fe3eecc676"
}
+80 -16
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LibreBible Catalog | Christ IT</title> <title>LibreBible Catalog | Christ IT</title>
<meta name="description" content="Public catalog of free Bible translation resources prepared for Libre Study and other Christ IT tools."> <meta name="description" content="Public catalog of free Bible translations, commentaries, dictionaries, and study resources prepared for Libre Study and other Christ IT tools.">
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='12' fill='%23111827'/%3E%3Crect x='29' y='10' width='8' height='44' rx='3' fill='%23f8fafc'/%3E%3Crect x='16' y='25' width='34' height='8' rx='3' fill='%23f97316'/%3E%3C/svg%3E" type="image/svg+xml"> <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='12' fill='%23111827'/%3E%3Crect x='29' y='10' width='8' height='44' rx='3' fill='%23f8fafc'/%3E%3Crect x='16' y='25' width='34' height='8' rx='3' fill='%23f97316'/%3E%3C/svg%3E" type="image/svg+xml">
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -297,7 +297,7 @@
<div class="container"> <div class="container">
<span class="eyebrow"><i class="fa-solid fa-book-bible"></i> Public Bible resource catalog</span> <span class="eyebrow"><i class="fa-solid fa-book-bible"></i> Public Bible resource catalog</span>
<h1>LibreBible</h1> <h1>LibreBible</h1>
<p class="hero-copy">A growing catalog of free-to-use Bible translations and attached study resources prepared for Libre Study, GracePress, and future Christ IT tools.</p> <p class="hero-copy">A growing catalog of free-to-use Bible translations, commentaries, dictionaries, and attached study resources prepared for Libre Study, GracePress, and future Christ IT tools.</p>
<div class="button-row"> <div class="button-row">
<a class="button" href="https://git.christit.com/libre-study/libre-bible-data"><i class="fa-solid fa-code-branch"></i> Source Repository</a> <a class="button" href="https://git.christit.com/libre-study/libre-bible-data"><i class="fa-solid fa-code-branch"></i> Source Repository</a>
<a class="button secondary" href="catalog/catalog.json"><i class="fa-solid fa-database"></i> Catalog JSON</a> <a class="button secondary" href="catalog/catalog.json"><i class="fa-solid fa-database"></i> Catalog JSON</a>
@@ -309,9 +309,9 @@
<div class="container"> <div class="container">
<div class="summary-grid" id="summary" aria-live="polite"> <div class="summary-grid" id="summary" aria-live="polite">
<div class="stat"><span>Resources</span><strong id="resource-count">-</strong></div> <div class="stat"><span>Resources</span><strong id="resource-count">-</strong></div>
<div class="stat"><span>Translations</span><strong id="translation-count">-</strong></div> <div class="stat"><span>Study Helps</span><strong id="study-help-count">-</strong></div>
<div class="stat"><span>Verses</span><strong id="verse-count">-</strong></div> <div class="stat"><span>Verses</span><strong id="verse-count">-</strong></div>
<div class="stat"><span>Strong's Links</span><strong id="strongs-count">-</strong></div> <div class="stat"><span>Study Entries</span><strong id="entry-count">-</strong></div>
</div> </div>
<div class="toolbar"> <div class="toolbar">
@@ -397,11 +397,15 @@
const badges = document.createElement("div"); const badges = document.createElement("div");
badges.className = "badge-row"; badges.className = "badge-row";
badges.append( badges.append(
makeBadge(iconForType(resource.resource_type), labelForType(resource.resource_type)),
makeBadge("fa-solid fa-language", `${text(resource.language && resource.language.name)}${resource.language && resource.language.dialect ? " / " + resource.language.dialect : ""}`), makeBadge("fa-solid fa-language", `${text(resource.language && resource.language.name)}${resource.language && resource.language.dialect ? " / " + resource.language.dialect : ""}`),
makeBadge("fa-solid fa-scale-balanced", text(resource.license && resource.license.name)), makeBadge("fa-solid fa-scale-balanced", text(resource.license && resource.license.name))
makeBadge("fa-solid fa-book-open", text(resource.canon && resource.canon.scope))
); );
if (resource.canon && resource.canon.scope && resource.resource_type === "translation") {
badges.append(makeBadge("fa-solid fa-book-open", text(resource.canon.scope)));
}
const features = document.createElement("div"); const features = document.createElement("div");
features.className = "feature-row"; features.className = "feature-row";
const featureLabels = (resource.catalog_display && resource.catalog_display.primary_features) || (resource.features || []).map((feature) => feature.label); const featureLabels = (resource.catalog_display && resource.catalog_display.primary_features) || (resource.features || []).map((feature) => feature.label);
@@ -409,12 +413,7 @@
const details = document.createElement("div"); const details = document.createElement("div");
details.className = "detail-grid"; details.className = "detail-grid";
details.append( details.append(...detailsForResource(resource));
makeDetail("Translation", `${text(resource.translation && resource.translation.base_title)} (${text(resource.translation && resource.translation.translation_year)})`),
makeDetail("Edition", `${text(resource.translation && resource.translation.edition)}${resource.translation && resource.translation.edition_year ? " / " + resource.translation.edition_year : ""}`),
makeDetail("Source", `${text(resource.source && resource.source.provider)} / ${text(resource.source && resource.source.upstream_id)}`),
makeDetail("Counts", `${number(resource.counts && resource.counts.verses)} verses, ${number(resource.counts && resource.counts.strongs_links)} Strong's links`)
);
card.append(head, summary, badges, features, details); card.append(head, summary, badges, features, details);
return card; return card;
@@ -422,14 +421,17 @@
function renderCatalog(catalog) { function renderCatalog(catalog) {
const resources = Array.isArray(catalog.resources) ? catalog.resources : []; const resources = Array.isArray(catalog.resources) ? catalog.resources : [];
const translations = resources.filter((resource) => resource.resource_type === "translation"); const studyHelps = resources.filter((resource) => resource.resource_type !== "translation");
const verseTotal = resources.reduce((sum, resource) => sum + (resource.counts && Number(resource.counts.verses) || 0), 0); const verseTotal = resources.reduce((sum, resource) => sum + (resource.counts && Number(resource.counts.verses) || 0), 0);
const strongsTotal = resources.reduce((sum, resource) => sum + (resource.counts && Number(resource.counts.strongs_links) || 0), 0); const entryTotal = resources.reduce((sum, resource) => {
const counts = resource.counts || {};
return sum + (Number(counts.entries) || 0) + (Number(counts.strongs_links) || 0);
}, 0);
document.getElementById("resource-count").textContent = number(resources.length); document.getElementById("resource-count").textContent = number(resources.length);
document.getElementById("translation-count").textContent = number(translations.length); document.getElementById("study-help-count").textContent = number(studyHelps.length);
document.getElementById("verse-count").textContent = number(verseTotal); document.getElementById("verse-count").textContent = number(verseTotal);
document.getElementById("strongs-count").textContent = number(strongsTotal); document.getElementById("entry-count").textContent = number(entryTotal);
document.getElementById("catalog-status").textContent = `Generated ${text(catalog.generated_at)}`; document.getElementById("catalog-status").textContent = `Generated ${text(catalog.generated_at)}`;
const list = document.getElementById("resource-list"); const list = document.getElementById("resource-list");
@@ -443,6 +445,68 @@
} }
} }
function labelForType(type) {
const labels = {
translation: "Translation",
commentary: "Commentary",
dictionary: "Dictionary",
lexicon: "Lexicon",
map: "Map",
cross_reference: "Cross references",
study_notes: "Study notes"
};
return labels[type] || text(type, "Resource");
}
function iconForType(type) {
const icons = {
translation: "fa-solid fa-book-bible",
commentary: "fa-solid fa-book-open-reader",
dictionary: "fa-solid fa-spell-check",
lexicon: "fa-solid fa-language",
map: "fa-solid fa-map-location-dot",
cross_reference: "fa-solid fa-arrows-turn-to-dots",
study_notes: "fa-solid fa-note-sticky"
};
return icons[type] || "fa-solid fa-cube";
}
function detailsForResource(resource) {
if (resource.resource_type === "translation") {
return [
makeDetail("Translation", `${text(resource.translation && resource.translation.base_title)} (${text(resource.translation && resource.translation.translation_year)})`),
makeDetail("Edition", `${text(resource.translation && resource.translation.edition)}${resource.translation && resource.translation.edition_year ? " / " + resource.translation.edition_year : ""}`),
makeDetail("Source", `${text(resource.source && resource.source.provider)} / ${text(resource.source && resource.source.upstream_id)}`),
makeDetail("Counts", `${number(resource.counts && resource.counts.verses)} verses, ${number(resource.counts && resource.counts.strongs_links)} Strong's links`)
];
}
if (resource.resource_type === "commentary") {
return [
makeDetail("Resource Type", "Commentary"),
makeDetail("Entries", `${number(resource.counts && (resource.counts.commentary_entries || resource.counts.entries))} commentary entries`),
makeDetail("Source", `${text(resource.source && resource.source.provider)} / ${text(resource.source && resource.source.upstream_id)}`),
makeDetail("Anchors", "Book, chapter, verse, and verse range")
];
}
if (resource.resource_type === "dictionary" || resource.resource_type === "lexicon") {
return [
makeDetail("Resource Type", labelForType(resource.resource_type)),
makeDetail("Entries", `${number(resource.counts && (resource.counts.dictionary_entries || resource.counts.entries))} entries`),
makeDetail("Source", `${text(resource.source && resource.source.provider)} / ${text(resource.source && resource.source.upstream_id)}`),
makeDetail("Anchors", "Dictionary key, Strong's number, topic, or lemma")
];
}
return [
makeDetail("Resource Type", labelForType(resource.resource_type)),
makeDetail("Entries", `${number(resource.counts && resource.counts.entries)} entries`),
makeDetail("Source", `${text(resource.source && resource.source.provider)} / ${text(resource.source && resource.source.upstream_id)}`),
makeDetail("License", text(resource.license && resource.license.name))
];
}
fetch(catalogUrl, { cache: "no-cache" }) fetch(catalogUrl, { cache: "no-cache" })
.then((response) => { .then((response) => {
if (!response.ok) { if (!response.ok) {