In order to develop standards-based EPUBs while also retaining data types for use in our applications, we use a set of unique data attributes.
Data attributes are an HTML5 approach to storing unique data for applications. The data attributes described in this chapter act as hooks for our conversion scripts that transform finished EPUBs for ingestion and upload to our content servers.
Data Attribute Syntax
Each data attribute follows the same pattern. The data attribute is data-x
, where ‘x’ is the type, and the value is a simple string, as seen here.
<element data-x="value"> |
Scripture Value Syntax (OSIS)
All Scripture references that are values for data attributes must be formatted according to OSIS book abbreviations and reference notation. OSIS is an entire specification for marking up Bibles in XML, but we are borrowing the spec only for Scripture references to use within our data attributes.
See OSIS Bible Book Abbreviations.
A b.c.v (book.chapter.verse) reference is made up of the OSIS book abbreviation, the chapter number, and the verse number, period delimited as shown. For the sake of brevity, we will refer to these types of notations as OSIS.
Gen.1.1-Gen.1.2 |
The above snippet is an example OSIS for Genesis 1:1-2.
Verses in single chapter books should always be referenced using 1 as the chapter number (e.g., Jude.1.3
)
Make sure to keep track of what each data attribute requires as its OSIS (whether b.c.v, b.c., or b).
Scripture References
Scripture references use the full b.c.v notation, and just as with the Scripture context attribute, a reference to more than one verse must be b.c.v-b.c.v.
All Scripture references in each volume must be tagged, non-orphaned and orphaned references alike.
<a data-ref="Rom.3.23">Romans 3:23</a> |
Workbook Questions and Answers
Workbook enhancements are a Content Platform (Wordsearch web app) feature, used for marking question text and answer locations wherever it is desirable to give the user a text box in which to record their answer to a question or exercise. See Dev Process > Workbook Enhancements for more info on this feature.
The element containing the question text should receive the data-wb-question
attribute where the value is an identifier unique to that question. (Each data-wb-question
value must be unique within the EPUB)
<p class="ind1" data-wb-question="chap14-1">1. How does Luke describe Athens and its people (17:16, 21)?</p> |
Normally, the app will insert the answer UI directly after the question element. But, you can optionally use the data-wb-answer
attribute to specify where the answer UI should be placed. The reading application will replace the indicated element with the answer UI and ultimately the answer text.
The data-wb-answer
value must match the value of the question to which it corresponds
<p class="br-before" data-wb-question="chap04-22"><span class="b">1.</span> Which of the following did the risen Jesus say in Matthew’s gospel?</p> |
Strong’s Numbers
Strong’s number references receive a data-strongs
attribute and a value string starting with H
for Hebrew or G
for Greek and the number.
<span data-strongs="G2424">Jesus</span> <span data-strongs="G5547">Christ</span> |
Multiple Strong’s numbers can exist in the value, and should be separated by commas
<span data-strongs="H2416,H5315">everything that has the breath of life</span> |
GK Numbers
Goodrick-Kohlenberger number references are similar to Strong’s numbers, except they receive a data-gk
attribute.
<span data-gk="G4036">Therefore</span> <span data-gk="G4005,G1569">whoever</span> |
Both Strong’s and GK number data attributes can be used on the same element, and the order of the attributes doesn’t matter.
<span data-strongs="H7225" data-gk="H8040">beginning</span> |
Words of Jesus
In Bibles (and only in Bibles), the words of Jesus may be tagged with the data-speaker
attribute. This was built for potential extensibility to all biblical speech acts, but for now, the only value should be "Jesus"
.
<span data-speaker="Jesus">"Have you understood all these things?"</span> |
Script-Specific Data Attributes
Parsing Context
Parsing data attributes inform percival
of the general portion of scripture being discussed. Frequently, authors will not use complete book-chapter-verse references, and though percival does a pretty decent job figuring out context on its own, adding parsing tags can help it make fewer mistakes and produce fewer no-context Scripture tags.
Scripture parsing context is identified by the data-parsing
attribute, and its value is an OSIS of type b or b.c only.
A <span>
tag may be used in places where an <hr>
is not appropriate.
<hr data-parsing="Gen.1" /> |
Do Not Parse
To indicate that a specific portion of text should not be parsed as Scripture, use data-parsing
along with an empty value. Remember to use with a <span>
element, rather than <hr>
.
<span data-parsing=""></span>123:4<span data-parsing="Gen"></span> |