Bible Markup Pattern: A Proposal

(Also pub­lished at God­bit.)

What is the best way to mark up text from the Bible? I’ve been think­ing about this ques­tion for more than a year, and in that time I have sought an answer, or at least a proposal.

If you’re impa­tient, here are the exam­ples: Exo­dus 20, Psalm 23, Matthew 5, and Matthew 6:5–15.

Caveats

Please remem­ber this arti­cle presents only a pro­posal for con­sid­er­a­tion. I am no the­olo­gian; nor am I a renowned expert on front-​end code. Nor does every page of every site I’ve ever built have “best” markup, how­ever I do make every effort to do so.

How­ever, it seems to me that–of all texts in the world–it should be impor­tant to make an effort toward best prac­tices in mark­ing up the Bible.

Of course, I wel­come cor­rec­tions and com­men­tary, any thoughts or additions.

Back­ground

Some good work has been done on cita­tion of online Bible quotes, includ­ing BibleRef and Open​Bible​.info. There are even some Word­Press plu­g­ins for BibleRef.

Bibleref is a sim­ple approach to auto­mat­i­cally iden­ti­fy­ing Bible ref­er­ences [in] web pages.

I use and rec­om­mend BibleRef, which is a foun­da­tional pro­posal that focuses directly on the cita­tion, for exam­ple: <cite class="bibleref">2 Tim 3:16</cite>. All of the present exam­ples use the BibleRef cita­tion format.

But I wanted some­thing more com­pre­hen­sive, that would help with mark­ing up entire bib­li­cal texts or even a whole Bible.

Bibleref is part of a gen­eral move­ment toward markup that expresses more seman­tic, rather than pre­sen­ta­tional, element.

So, my ques­tion is broader than cita­tion for­mat: what ele­ments should we use,
as best practice?

What’s “Best”?

When con­sid­er­ing what may be a “best” way to mark up the Bible, sev­eral require­ments or prin­ci­ples come to mind.

First, it means using (X)HTML in a way that is valid, min­i­mal, and seman­tic. In this case, the term “valid” means essen­tially “meet­ing the require­ments set by the W3C of the spec­i­fi­ca­tion selected by the Doc­type of that document.”

“Min­i­mal” refers to adding as few ele­ments and attrib­utes as rea­son­ably pos­si­ble to the text itself, while pre­serv­ing its structure.

And for pur­poses of this arti­cle, “seman­tic” means a few things: using mean­ing­ful ele­ments that match each por­tion of the text, and com­mu­ni­cate its func­tional mean­ing. In other words, if some text is a pri­mary head­ing, use an <h1></h1> (head­ing) ele­ment; if it’s a para­graph, use a <p></p> (para­graph) ele­ment; if a block quote, use a <blockquote></blockquote> ele­ment, etc.

The word “seman­tic” also man­dates gen­eral web stan­dards prin­ci­ples, including:

  • no tables for layout,
  • avoid inline styles,
  • avoid frames,
  • avoid numer­ous <div></div> and <span></span> ele­ments (espe­cially those with class attrib­utes that mimic other ele­ments, like head­ings and paragraphs),
  • don’t require JavaScript or Flash.

CMS – Friendly

Another prin­ci­ple for my project is to rec­og­nize the ubiq­uity of the con­tent man­age­ment sys­tem. Most cur­rent con­tent on the web is no longer in sta­tic web pages; rather, it is stored in a data­base and pre­sented dynam­i­cally when some­one asks for it.

So, the four exam­ples I’ve pre­pared are all marked up using the excel­lent Tex­tile syn­tax, the “humane Web text generator”.

Not a Microformat

I sup­port and use Micro­for­mats, but it should be noted that this Bible markup pat­tern is not a Micro­for­mat, and for var­i­ous rea­sons it prob­a­bly never will be.

Cur­rent Practice

I did some research on how some pub­lish­ers and ver­sions are pre­sented on the web, basi­cally by look­ing at as many of these four exam­ples in the four ver­sions that were avail­able on these five sites: Bible Gate­way, Eng­lish Stan­dard Ver­sion, eBible, You­Ver­sion, and WEB Bible.

The markup was about what you might expect from large sites with big con­tent man­age­ment sys­tems. With very few excep­tions, the markup of the pages were all invalid, not min­i­mal, and not semantic.

How­ever, they all at least declared a Doc­type, and com­pared to many enor­mous com­mer­cial sites, most of the markup was rather clean. In fact, almost all used head­ing ele­ments well, and used some arrange­ment of mainly para­graph ele­ments with some class attrib­utes. Depend­ing on the con­tent man­age­ment sys­tem, my impres­sion is that much of this Bible text markup could be much improved with­out undue effort.

Thing One, and Thing Two

Some infor­mal study indi­cates there seem to be two basic seman­tic types or “gen­res” of bib­li­cal text.

The first type can be cat­e­go­rized as prose, and includes para­graphs, lists, and block quotes. The sec­ond type may be called verse, which includes poems, songs, and other lyri­cal matter.

I real­ize this may be gross over-​simplification, but when con­struct­ing any tax­on­omy there is a ten­sion in select­ing the num­ber of cat­e­gories. In this case, I pro­pose sim­ply two cat­e­gories, which adds seman­tic rich­ness while being sim­ple enough for this intro­duc­tory article.

The two main gen­res in the Bible are nar­ra­tive and poetry.
Edi­tors’ Pref­ace to the ESV Lit­er­ary Study Bible

Even a sim­ple two-​category tax­on­omy can yield pow­er­ful results: pick up a Bible and com­pare Gen­e­sis to Psalms, which con­tain mostly prose and verse respec­tively. It’s obvi­ous they are pre­sented dif­fer­ently, and this basic pre­sen­ta­tional char­ac­ter can be pre­served in the markup.

Exam­ples

As exam­ples of this pro­posed Bible markup pat­tern, it seemed appro­pri­ate to use pas­sages from both Old and New Tes­ta­ments, includ­ing prose, block quotes, and verse.

I selected four texts as exam­ples, which are posted on my blog: Exo­dus 20, Psalm 23, Matthew 5, and Matthew 6:5–15. These pas­sages are also known as the Ten Com­mand­ments, the Beat­i­tudes, the Lord’s Prayer, and … the Twenty-​Third Psalm.

Each exam­ple is pre­sented in a dif­fer­ent ver­sion: Exo­dus 20 in the NIV, Psalm 23 in the ESV, Matthew 5 in the WEB, and Matthew 6:5–15 in the KJV.

Overview: The Method

  1. Bible: The first step is sim­ple: a con­tainer ele­ment, such as a <div></div>, gets a class attribute of “bible”.
  2. Head­ings: The sec­ond step is also easy: Head­ings use head­ing ele­ments, such as <h2></h2>, <h3></h3>, etc.
  3. Para­graphs: Put almost every­thing else in a paragraph.
  4. Block quotes: sur­round one or more para­graphs of a block quote in a <blockquote></blockquote> element.
  5. Verse num­bers and Foot­notes: At first, I thought it would be clever to use ordered lists for the verse num­bers, but that only works if every­one begins all their Bible quo­ta­tions from the begin­ning of a chap­ter. So, verse num­bers are <sup></sup> ele­ments. Sim­i­larly, foot­note ref­er­ence num­bers are <sup></sup> ele­ments with a class attribute of “footnote”.
  6. Verse, Poetry, etc.: As between “prose” and “verse,” I chose to make “prose” the default. If some or all of a pas­sage is verse, then enclose that text with an ele­ment (such as a <span></span>) with a class attribute of “verse”.
  7. Addi­tional: There are a few addi­tional aspects, includ­ing div ele­ments to enclose multi-​paragraph “stan­zas” of verse (see Psalm 23), and the markup of the footnotes.

The Styles

For ease of ref­er­ence, the Bible style infor­ma­tion is embed­ded in the head of the exam­ples, so you can sim­ply view the page source.

In actual use, they should be included in a sep­a­rate CSS file with the other styles for that page. A sam­ple CSS file of the Bible styles is avail­able for down­load.

The Future

Some thoughts for the future:

  • How to markup Selah or a clos­ing Amen? Per­haps class="affirmation"?
  • Ini­tial caps for the chap­ter num­ber, super­sed­ing the verse num­ber of the first verse of that chapter?
  • Per­haps a print stylesheet, for select­ing a slightly dif­fer­ent font stack, or siz­ing the printed text in points.
  • And the one I’m almost afraid to ask, what about class="wordsofchrist"?

Let the dis­cus­sion begin….

This arti­cle is © Mont­gomery 2008. Some rights released with a Cre­ative Com­mons Attribution-​NonCommercial-​ShareAlike 2.5 License.


Comments are closed.