New Version
I have created a new version, mostly to handle the unique structure of Psalms. It’s at
http://fourwindssoft.com/scott/Tiddlywiki/Demo/KingJamesBible/v5/
The sources are at
http://fourwindssoft.com/scott/Tiddlywiki/Demo/KingJamesBible/v5/sources
Feature Complete
At this point, I consider this basically feature complete. While I’d love to hear suggestions for ways to make the implementation more robust, more performant, more logical, etc., I won’t be adding features soon. I will probably work on creating a better source JSON document. What I started with was great, but it’s not structured in a way I’d like to work with. That will only affect my conversion script, and not the wiki itself. That might also let me easily make an alternate version suggested by @TW_Tones in #10177/30 et. seq.. If so, I might at some point play around with that alternative approach to see which is more flexible and which is more maintainable.
At the bottom, I will discuss some potential work built atop this.
Differences in Psalms
You can easily see the visual difference between the old version (and specifically Psalm 119) the new one (again, Psalm 119).
Psalms has a number of differences from the other chapters:
- The paragraph structure from other chapters is ignored here, even though such information is in my original source. Instead each verse is its own stand-alone line.
- The lines are almost universally formatted more narrowly as to evoke thoughts of poetry, not prose.
- In my original source document, in all other chapters, square brackets represent
[italics]
which my script converts to //italics//
, but in Psalms they appear appear literally in the text.
- More than 75% of the Psalms have an inscription, an epitaph, that’s not part of the verses.
- Psalm 119 is broken into what we might call stanzas, each titled with a letter of the Hebrew alphabet.
- There is a little-noted grouping of the Psalms into “Book I”, “Book II”, … “Book V”. It typically just shows up as a header on the first psalm in the group.
Implementation
The inscriptions are the biggest challenge. My original source includes them within the first verse of the relevant psalm, with no delineation. To fix this, I manually made an updated version of the raw data, Enhanced-KJV.json, adding a pipe (|
) delimiter between the inscription and the actual verse text
{
"book_name": "Psalms",
"book": 19,
"chapter": 16,
"verse": 1,
"text": "\u00b6 Michtam of David.|Preserve me, O God: for in thee do I put my trust."
/* ^--- right here */
},
and updated my conversion script to generate these:
{
"title": "Psalms 16",
"tags": "Chapter [[Psalms]]",
"book": "Psalms",
"chapter": "16",
"inscription": "Michtam of David.",
/* \_______________________________/------- added */
"psalm-section": "Book I",
"seq": "14606"
},
{
"title": "Psalms 16:1",
"tags": "Verse [[Psalms 16]]",
"book": "Psalms",
"chapter": "16",
"verse": "1",
"text": "Preserve me, O God: for in thee do I put my trust.",
/* \__________________________________________________/----- reduced */
"seq": "14607",
"para": "1"
},
Then I separated $:/_/bible/templates/chapter into three parts: the general wrapper and the specific handlers $:/_/bible/templates/psalms and $:/_/bible/templates/most-books. The handler for Psalms can now manage the additional formatting and the presentation of inscriptions.
The conversion script also skipped the italic handling for Psalms. That was trivial to solve.
For the “Book I” … “Book V”, you can see a psalm-section
field in the Chapter tiddler of the previous example. I created this while I processed the original source using some JS that just hard-codes the ranges:
const getPsalmBook = ((books) => (book) => books.find(({end}) => book < end).title)([
{title: 'Book I', end: 41},
{title: 'Book II', end: 72},
{title: 'Book III', end: 89},
{title: 'Book IV', end: 106},
{title: 'Book V', end: 150},
])
(You don’t need any real knowledge of JS to see that I’ve simply associated the "Book"s with the final verse of each one.)
Finally, to handle the stanzas for Psalm 119, I added to the enhanced JSON: a “preface” tag to each verse that starts a new stanza—and I don’t know if “stanza” is what biblical scholars actually call these!—with the text that appears above: a spelled-out Hebrew letter.
To display these changes, I needed to add a stylesheet. I’d been hoping to avoid creating one. I want this wiki to be as minimal as possible. But I couldn’t see a way around it, and at least it’s still small:
.chapter.poetry {
p {margin: .1em 1em; width: 25em;}
p.stanza {margin: 2em 0 1em; font-weight: 500;}
p.inscription {background: #f0f0f0; padding: .25em;}
}
Additional Fixes
There are two other minor fixes included here, ones recommended by @saqimtiaz in a separate thread.
Future Work
A number of people have suggested directions this could go. My core idea here is to collect the biblical text in a way that it can be reused. The wiki itself is meant to be a baseline that users of that textual data could either build upon or ignore entirely. So below I discuss some of the things I’d like to do, but the main point is what other users might like to try.
I’m especially intrigued by suggestions from Springer about handling “theme” metadata, and about abstracting the notions here to handle other sorts of text that inspire close exegesis. I definitely would love to see a version that has a robust commentary feature, with a many-to-many relationship between commentaries and Books/Chapters/Verses, and possibly even a meta-commentary or layered-commentary.
While this started with the King James Version, I’ve hoped all along that other translations could be handled easily. And I think they will be except for the metadata I had to add here to handle Psalms. That should be most an annoyance, though. If you have to edit the inscriptions of 116 of the Psalms, but everything else comes along for free, I think it’s still a win.
I’d like to investigate the pros and cons of moving the textual data to a plugin, making it easy to recover from overlaying the biblical text with our own. I would need to figure out how to do this without breaking the default search. I expect that wouldn’t be too hard, but I’ve never tried enhancing that.
There is one very specific layout change I would love to try. But it’s not one I’ve ever done or even seen done, and I’m not quite sure how to approach it. In the current version, the superscripted verse-number links preceding the verses are the best I could come up with quickly. But I find them a bit of an annoyance. I would love it if instead the text was clean, with no verse numbers in sight. But in a gutter to the left (or the right) of the text, lined up with the start of each verse, are those links. If you click on one, you open the corresponding verse tiddler. But if you hover, you highlight the verse, and maybe have a visible title somewhere so that when you hover, say, "7"
you get the full path: "1 John 4:7"
.
And there’s so much more. How would you see this expanding?