Bible Markup Pattern: A Proposal

_(Also published at_ “Godbit”:http://godbit.com/article/bible-markup-pattern.)

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

If you’re impatient, here are the examples: “Exodus 20”:http://michaelmontgomery.net/bible/exodus-20, “Psalm 23”:http://michaelmontgomery.net/bible/psalm-23, “Matthew 5”:http://michaelmontgomery.net/bible/matthew-5, and “Matthew 6:5-15”:http://michaelmontgomery.net/bible/Lord%27s+Prayer.

h3. Caveats

Please remember this article presents only a proposal for consideration. I am no theologian; nor am I a renowned expert on front-end code. Nor does every page of every site I’ve ever built have “best” markup, however I do make every effort to do so.

However, it seems to me that–of all texts in the world–it should be important to make an effort toward best practices in marking up the Bible.

Of course, I welcome corrections and commentary, any thoughts or additions.

h3. Background

Some good work has been done on citation of online Bible quotes, including “BibleRef”:http://www.semanticbible.com/bibleref/bibleref-overview.html and “OpenBible.info”:http://www.openbible.info/blog/2007/05/bible-microformats/. There are even some “WordPress plugins”:http://www.semanticbible.com/bibleref/bibleref-faq.html#wordpress for BibleRef.

bq. Bibleref is a simple approach to automatically identifying Bible references [in] web pages.

I use and recommend BibleRef, which is a foundational proposal that focuses directly on the citation, for example: @2 Tim 3:16@. All of the present examples use the “BibleRef”:http://www.semanticbible.com/bibleref/bibleref-overview.html citation format.

But I wanted something more comprehensive, that would help with marking up entire biblical texts or even a whole Bible.

bq. Bibleref is part of a general movement toward markup that expresses more semantic, rather than presentational, element.

So, my question is broader than citation format: what elements should we use,
as best practice?

h3. What’s “Best”?

When considering what may be a “best” way to mark up the Bible, several requirements or principles come to mind.

First, it means using (X)HTML in a way that is valid, minimal, and semantic. In this case, the term *”valid”* means essentially “meeting the requirements set by the “W3C”:http://www.w3.org/ of the specification selected by the “Doctype”:http://www.w3.org/QA/Tips/Doctype of that document.”

*”Minimal”* refers to adding as few “elements and attributes”:http://www.w3.org/TR/xhtml1/#general as reasonably possible to the text itself, while preserving its structure.

And for purposes of this article, *”semantic”* means a few things: using meaningful elements that match each portion of the text, and communicate its functional meaning. In other words, if some text is a primary heading, use an

(heading) element; if it’s a paragraph, use a

(paragraph) element; if a block quote, use a

element, etc.

The word “semantic” also mandates general web standards principles, including:

* no tables for layout,
* avoid inline styles,
* avoid frames,
* avoid numerous

and elements (especially those with class attributes that mimic other elements, like headings and paragraphs),
* don’t require JavaScript or Flash.

h4. CMS(Content Management Systems) – Friendly

Another principle for my project is to recognize the ubiquity of the “content management system”:http://en.wikipedia.org/wiki/Content_management_system. Most current content on the web is no longer in static web pages; rather, it is stored in a database and presented dynamically when someone asks for it.

So, the four examples I’ve prepared are all marked up using the excellent “Textile”:http://textile.thresholdstate.com/ syntax, the “humane Web text generator”.

h3. Not a Microformat

I support and use “Microformats”:http://microformats.org/, but it should be noted that this Bible markup pattern is _not_ a Microformat, and for various reasons it probably never will be.

h3. Current Practice

I did some research on how some publishers and versions are presented on the web, basically by looking at as many of these four examples in the four versions that were available on these five sites: “Bible Gateway”:http://www.biblegateway.com/, “English Standard Version”:http://www.gnpcb.org/esv/, “eBible”:http://www.ebible.com/, “YouVersion”:http://youversion.com/, and “WEB Bible”:http://www.ebible.org/web/.

The markup was about what you might expect from large sites with big content management systems. With very few exceptions, the markup of the pages were all invalid, not minimal, and not semantic.

However, they all at least declared a Doctype, and compared to many enormous commercial sites, most of the markup was rather clean. In fact, almost all used heading elements well, and used some arrangement of mainly paragraph elements with some class attributes. Depending on the content management system, my impression is that much of this Bible text markup could be much improved without undue effort.

h3. Thing One, and Thing Two

Some informal study indicates there seem to be two basic semantic types or “genres” of biblical text.

The first type can be categorized as _prose_, and includes paragraphs, lists, and block quotes. The second type may be called _verse_, which includes poems, songs, and other lyrical matter.

I realize this may be gross over-simplification, but when constructing any taxonomy there is a tension in selecting the number of categories. In this case, I propose simply two categories, which adds semantic richness while being simple enough for this introductory article.

bq. The two main genres in the Bible are narrative and poetry.
— “Editors’ Preface”:http://www.esvliterarystudybible.org/preface to the “ESV”:http://www.gnpcb.org/esv/ Literary Study Bible

p. Even a simple two-category taxonomy can yield powerful results: pick up a Bible and compare Genesis to Psalms, which contain mostly _prose_ and _verse_ respectively. It’s obvious they are presented differently, and this basic presentational character can be preserved in the markup.

h3. Examples

As examples of this proposed Bible markup pattern, it seemed appropriate to use passages from both Old and New Testaments, including prose, block quotes, and verse.

I selected four texts as examples, which are posted on my blog: “Exodus 20”:http://michaelmontgomery.net/bible/exodus-20, “Psalm 23”:http://michaelmontgomery.net/bible/psalm-23, “Matthew 5”:http://michaelmontgomery.net/bible/matthew-5, and “Matthew 6:5-15”:http://michaelmontgomery.net/bible/Lord%27s+Prayer. These passages are also known as the Ten Commandments, the Beatitudes, the Lord’s Prayer, and … the Twenty-Third Psalm.

Each example is presented in a different version: Exodus 20 in the NIV(New International Version), Psalm 23 in the ESV(English Standard Version), Matthew 5 in the WEB(Web English Bible), and Matthew 6:5-15 in the KJV(King James Version).

h3. Overview: The Method

# *Bible:* The first step is simple: a container element, such as a

, gets a class attribute of “bible”.
# *Headings:* The second step is also easy: Headings use heading elements, such as


, etc.
# *Paragraphs:* Put almost everything else in a paragraph.
# *Block quotes:* surround one or more paragraphs of a block quote in a

# *Verse numbers and Footnotes:* At first, I thought it would be clever to use ordered lists for the verse numbers, but that only works if everyone begins all their Bible quotations from the beginning of a chapter. So, verse numbers are elements. Similarly, footnote reference numbers are elements with a class attribute of “footnote”.
# *Verse, Poetry, etc.:* As between “prose” and “verse,” I chose to make “prose” the default. If some or all of a passage is verse, then enclose that text with an element (such as a ) with a class attribute of “verse”.
# *Additional:* There are a few additional aspects, including div elements to enclose multi-paragraph “stanzas” of verse (see “Psalm 23”:http://michaelmontgomery.net/bible/psalm-23), and the markup of the footnotes.

h3. The Styles

For ease of reference, the Bible style information is embedded in the head of the examples, so you can simply view the page source.

In actual use, they should be included in a separate CSS(Cascading Style Sheet) file with the other styles for that page. A sample CSS file of the Bible styles is available for “download”:http://godbit.com/file_download/48/Bible.css.

h3. The Future

Some thoughts for the future:

* How to markup _Selah_ or a closing _Amen_? Perhaps class="affirmation"?
* Initial caps for the chapter number, superseding the verse number of the first verse of that chapter?
* Perhaps a print stylesheet, for selecting a slightly different font stack, or sizing the printed text in points.
* And the one I’m almost afraid to ask, what about class="wordsofchrist"?

Let the discussion begin….

_This article is (c) Montgomery 2008. Some rights released with a_ Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.