The Publisher program prepares Bible Text for publication in the BibleApp. It expects the Bible text to be in USX form, and translates it into publication ready text stored in a Sqlite database. The Publisher program prepares the following content into the following Sqlite tables:
- tableContent: contains data needed to present a Table of Contents, page headings and abbreviations. i.e. bookCode, heading, title, name, abbrev, lastChapter, priorBook, nextBook, chapterRowId
- chapters: contains the Bible text in HTML form, and a reference as a primary key. An example reference is JHN:3
- concordance: contains one row for each word in the Bible, and an index to all references for that word.
- verses: contains one row of text for each verse in the Bible including the text. This is used to present search results. An example references is ROM:9:2-3
- styleUse: contain a list of USFM/USX styles that occurred in the translation and the references. This is used to ensure the App supports all of the needed styles.
- styleIndex: contains a summary list of the USFM/USX styles that occurred in the translation.
- charset: contains one row for each character that occurs. It is used during validation.
- identity: will contain identity and version information after the file is validated
This program has been tested with USX 2.0, USX 2.5 and USX 3.0.
Publisher expects a parameters on the command line. There is no configuration file
node Publisher.js inputDir outputDir bibleId iso3 iso1 direction
inputDir - This directory must contain all of the .usx files to process.
outputDir - This directory will receive the output in a file named {bibleId}.db
bibleId - This should be the primary identifier of the bible language and version.
iso3 - This should be the 3 character ISO 639-3 language code.
iso1 - This should be the 2 character ISO 639-1 language code or null when there is no iso1 code.
direction - This should be the direction of the script, either 'ltr' or 'rtl'.
The book sequence information can be picked up in anyone of three ways.
- If there is a DBL metadata.xml file, the program will use the sequence information in that file. The metadata.xml file can be in the same directory as the .usx files, or it can be one directory above. If it is anywhere else, it will be ignored.
- If there is no metadata.xml file, but .usx filenames contain a sequence numbers, such as 041MAT.usx, 042MRK.usx, then that number will be used to define the sequence.
- If there is neither a metadata.xml file, and there is no sequence numbers in the filenames, then the 66 book protestant Canon will be used to define the book sequence.
The Publisher program is written is node. To install node on a Linux machine using the package installer do the following:
apt-get install node node-sqlite3
The output of this process is a sqlite database. Any Sqlite database is stored in a single file that normally resides on the user's computer. Sqlite can be downloaded at: https://sqlite.org/download.html The database supports a simplified, but near standard SQL that will seem familiar to anyone who has used a different SQL database.
Some novel differences that one must know.
- To open a database simply type: sqlite3 filename
- To see a list of tables, type: .tables
- To see a description of a table, type: .schema tableName
- To exit sqlite, type: .exit