Skip to content

Building a Downloadable Bible Module

kerrishotts edited this page Feb 25, 2013 · 1 revision

Version 1.2 has the concept of a downloadable Bible Module. This means that new modules can be created, uploaded to Parse, and then users of the GiB can download them to their own device for offline use.

Creating modules is easy, especially with the use of the bibles.py script.

Pre-requisites

The following pre-requisites must be met:

Structure of the module

The structure is very much like the structure of the app's delivered bibleContent database. There's a bibles and a content table that follows the same structure. Instead of having multiple Bibles, each Bible module should have only one Bible text. As such only one row should exist in the bibles table, and only data for the Bible should be in the content table.

Creating the Bible Information Row

Let's say you were going to import the KJV. You'd have a command like the following:

./bibles.py kjv.db 8 KJV "King James\/Authorized Version" "info" rightSide commit

From left to right:

  • kvj.db - the database. If it doesn't exist, it'll be created.
  • 8 - the Bible ID. NOTE: ** EACH BIBLE ID MUST BE UNIQUE ** Contact the author of the app to get a unique ID.
  • KJV - the Bible's abbreviation. It doesn't have to be three letters -- but it shouldn't be more than seven or eight. It also doesn't need to be in all CAPS. (e.g., the "Webster" Bible Abbreviation.)
  • "King James/Authorized Version" - The title of the Bible. Escape where necessary.
  • "info" - The user-facing information, including attributions of the source. I never put all this in the initial command here -- I use a SQLite editor later to edit this piece of information. It can contain HTML, but generally use only H1, H2, P, and PRE.
  • rightSide - which side the text is for; the left is reserved for original manuscripts. So Greek and Hebrew texts would be "leftSide", while all other texts are "rightSide". Technically you can use "english" and "rightside" as well -- they mean the same thing.
  • commit - commit the changes. Without this, you'll see the row created, but it won't be saved.

Importing the OSIS data

So now that you have a Bible Information row, you can import the OSIS like so:

./bibles.py kjv.db import-bible KJV osis kjv.osis commit

Again, from left-to-right:

  • kjv.db - the database. It must exist. Although it will be created if it doesn't, it'll lack the Bible Information row that is used to look up the Bible ID for the abbreviation.
  • KJV - the Bible Abbreviation.
  • osis - the import format. Currently only "osis" is supported.
  • kjv.osis - the OSIS file.
  • commit - commit the changes.

If the OSIS is not well-formed XML, the import will fail. You must correct any errors prior to importing, or the import will fail. OSIS source data isn't always well-formed, and as such you can expect the import to fail on more complex documents. Use the error message to guide you to the place in the OSIS source that has the error.

Send for Distribution

Only the author of the GiB can upload files for use in the app. You need to send the completed SQLite file database to her, and she will test it and upload it to Parse. Once uploaded, it will be available to all users of the software.

NOTE: Only public domain text can be deployed unless a special license is given to use the text in the app. Therefore no copyrighted material will be accepted without a prior license to use said copyrighted material.