King James Bible Wiki

Running edit: The most recent version is v5, with an alternative approach in v7. And there is a mocked-up dream UI that I might not be able to implement, but which I would really like. at experiment1

Several discussions about bible-related TW content made me wonder how difficult it would be to put an entire version of the Christian bible into a TW wiki.

It turns out not too difficult. I found a JSON version of the King James bible online. (There are many of these.) Outside a little metadata, the content was just a list of verse records. I converted these to tiddlers, added Book and Chapter tiddlers, wrote a few templates and an overview page, and got this:

http://scott.sauyet.com/Tiddlywiki/Demo/KingJamesBible/v1/.

Feel free to use it, steal it, fold, spindle, and mutilate it as you like. If you want the raw data, see

http://scott.sauyet.com/Tiddlywiki/Demo/KingJamesBible/v1/sources/, with the following files

  • RAW-KJV.json, which is what I downloaded originally. I canā€™t seem to recall where itā€™s from; I will try to look at browser history next time Iā€™m on that machine. (Edit: I found it. I downloaded from: biblesupersearch.) The records look like this:

    {
      "book_name": "Genesis",
      "book": 1,
      "chapter": 1,
      "verse": 1,
      "text": "\u00b6 In the beginning God created the heaven and the earth."
    },
    

    The ā€œ\u00b6 ā€ is the Unicode escape for the pilcrow, Ā¶, and it is used to represent where new paragraphs start. Italics are handled by wrapping the text in [square brackets] The book property is just a sequence number to help sort the books. The other fields should be obvious.

  • TW5-KJV.json is the result of converting the above to tiddlers. It has records like:

    {
      "title": "Genesis 1:1",
      "tags": "Verse [[Genesis 1]]",
      "created": "20240712215242831",
      "modified": "20240712215242831",
      "book": "Genesis",
      "chapter": "1",
      "verse": "1",
      "text": "In the beginning God created the heaven and the earth.",
      "new-para": "yes",
      "seq": "3"
    },
    

    There are also interspersed tiddlers for Books and Chapters, with somewhat simpler formatting. If youā€™re interested in the JS code I used to convert this, itā€™s at http://link.sauyet.com/kjv.

    The new-para field just moves the paragraph handling from the text to a dedicated field. And seq is a sequence number that runs through all Book, Chapter, and Verse tiddlers. This can drastically simplify sorting.

  • KJV_Extras.json are just a very few templates and miscellaneous tiddlers to turn this into a minimally useful wiki.

You can add this bible to any wiki by dragging in the second file; you can give it usable default behavior by dragging in the third. Note that the data is large, almost 14MB, and will take ten seconds or so to show up in imports and at least five seconds to do the actual import.

The only template with any semblance of sophistication is $:/_/bible/procedures/chapter, which combines the verses into a whole chapter. While I mostly like the results, Iā€™m not happy with the implementation. I may ask some questions about it in the next few days.

Note that although I did this for the King James version, we should be able to easily do it for other versions using the same techniquesā€¦ assuming copyright protection laws donā€™t interfereā€¦


As I said, do with this as you like. Have fun. Let me know of issues.

2 Likes

Very interesting.

I think, you could reduce the size by 2MB if you remove the created and modified fields. They do not really have any value.

1 Like

This is very nicely done.

I think if the bible were presented to me like this, I would have paid more attention in church as a kid haha

(Though, maybe I would of been more distracted by tinkering, all things xonsidered)

Very interesting! I use the below button in my Wiki to remove creator/modifier/created/modified fields.


<$button> Remove creater, modifier, created, modified
<$list filter="[subfilter[$:/config/Production]]" >
<$action-deletefield $timestamp="no" creator modifier created modified/>
</$list>
</$button>

<$list filter="[subfilter[$:/config/Production]]" template="$:/core/ui/ListItemTemplate"/>

Where $:/config/Production is a tiddler containing filters to select candidates for removing extra fields. Example $:/config/Production

[tag[public]]
[prefix[doc/]]

Thanks @Scott_Sauyet - This is awesome and I will pull it to see if I can understand the logic.

Iā€™ve been looking for a way to incorporate my daily studies into TiddlyWiki - and am playing with various Bibles from various folks - and this is a treasure.

Thanks Again!

TwN00b

Youā€™re quite right. I donā€™t know why Iā€™ve gotten in the habit not only of manually creating these fields when I generate tiddlers, but also of putting the effort into setting the timestamps so that the Recent tab is in a particular order. Itā€™s ridiculous, and I will try to stop. Fixing this reduced the formatted JSON by 3MB and, as you said, reduced the generated wiki by 2MB. Thank youā€¦

Thank you. I do the same sort of thing fairly often. In this case, I would prefer to do it at the source: my JS generation of the tiddlers. But I learned something very useful from your code. I would probably have done

<$action-deletefield $timestamp="no" creator/>
<$action-deletefield $timestamp="no" modifier/>
<$action-deletefield $timestamp="no" created/>
<$action-deletefield $timestamp="no" modified/>

I didnā€™t realize that I could do it in one go. Nice!

(Also, for when these things get more complex, thank you very much for Commander!)


The updated code is at:

http://scott.sauyet.com/Tiddlywiki/Demo/KingJamesBible/v2

The updated source material is at:

http://scott.sauyet.com/Tiddlywiki/Demo/KingJamesBible/v2/sources/

And the updated (and simplified) conversion script is at

http://link.sauyet.com/kjv2

1 Like

:smiley:

Bingo!

If you have a reasonable grasp of ViewTemplates, then there is little to understand.

$:/_/bible/templates/book is a simple template using a TOC macro, as is King James Bible. Verses donā€™t need any template for now. The only real complexity is in $:/_/bible/procedures/chapter and $:/_/bible/templates/chapter, which calls it. And I will soon raise a topic asking how to simplify that.

Really nicely done.

I wish all books were presented like so. Iā€™m anewed reminded of the Text Slicer Edition

I have seen Text Slicer, but havenā€™t yet used it. This was simpler, since I started with one JS object/JSON record per verse.

I donā€™t particularly. I read very linearly. While I sometimes use a Kindle, Iā€™m still mostly a dead-trees reader. This is mostly speculation that others would find it useful. It would be more useful still in my mind if, say, Genesis transcluded all its chapters, but I couldnā€™t get that to work. Thatā€™s one of the questions Iā€™m planning on asking.

And of course this is also a learning opportunity. Iā€™ve never built a wiki with nearly this many tiddlers. I didnā€™t know how it would perform.

Is nicely done - and very usable. By removing the timestamp fields makes ā€˜Recentā€™ tab only show tiddlers the user enters as notes and such.

The data would be a great candidate for the upcoming MWS plugin - organized as recipes and bags stored server-side in the SQLite database. Performance would be greatly enhanced as would only retrieve content the user selects.

Absolutely. I can easily imagine each chapter as a bag, with fairly obvious recipes.

I still donā€™t recall my motivation for doing so the first time early last year, but Iā€™ve been auto-creating timestamps since for all my generated-tiddler wikis since then. In retrospect, it feels ridiculous.

I do the same thing - rule # 1 - tiddlers have a title, created, and modified field. But there are exceptions that make the rule - :slight_smile:

Do you have a good reason for it? I thought I did, but for the life of me, I canā€™t recall it.

But at the chapter level your creation does present the text linearly. It could be extended to also allow the full book to be presented linearly (in contrast to the current display that lists the chapters which, by the way, most regular books also do of course).

Iā€™m writing up my most significant question raised by creating this wiki. After that Iā€™ll write up my second one, which is why it failed when I attempted to do that. (I need a little more research first; I suspect it might have to do with transclusion not knowing about ViewTemplates, but Iā€™m not sure.)

So yes, I wanted to render full Books, and if it was too painfully slow, the entire bible as well.

I use the timestamp fields a lot - especially important if keeping a history of tiddler changes, if have a lot of transcluded tiddlers - can use a filter to select when the trancluded tiddler was modified which helps in debugging why tiddler that transcludes it - is broke.

Some tiddlers are time sensitive - updating data from an external source using http request.

Ultimately TiddlyWiki - " You can think of tiddlywiki as a database in which the records are tiddlers." - see https://tiddlywiki.com/static/Filters.html . It is normal practice for databases to timestamp records.

But donā€™t they still get a modified date on change, or do they need to have timestamps already? To me these are data tiddlers that usually would never get changed.

Sure, but in this case, the relevant dates look more like 1000 BCE, 90 AD, or perhaps 1611 AD. :slight_smile:

Right. If you hadnā€™t seen it, I started a discussion on another recent project to help document this.

Yes, but in space-constrained locations like TWs, ā€œnormal practiceā€ still needs to be justified. If youā€™re never going to use it, why take up memory and user attention with unnecessary fields?


Iā€™m sorry; the above sounds argumentative. I really donā€™t mean to be. Now that I stop and think about this habit for myself, I found that I canā€™t see the reasons. Thank you for sharing yours.

Sounds like blasphemy

Thanks @Scott_Sauyet for putting this together! In addition to everything else, it seems like a nice dataset for testing and demonstrating TiddlyWiki. Such as the mws, as mentioned above, and perhaps the books can be put into plugins to demonstrate how plugins can carry contents

When I get time, it would also be interesting to see if the liturgy and the texts of the Mass would fit in a TiddlyWiki - the shifting and reuse of text seems like an excellent task for TiddlyWiki. Maybe even the Liturgy of the Hours. The multilingual aspect is also an interesting challenge to demonstrate the power of TiddlyWiki

1 Like

:slight_smile:
I should use the creator/modifier field!