Epistemic Systems

[ cognition – information – knowledge – publishing – science – software ]

(X)HTML for poetry

leave a comment »

As mentioned in the previous post, I’ve recently been involved in the development of a markup scheme for Manchester University Press’s books publishing programme. That programme is especially strong in the humanities and literature, with the latter including plays and verse.

Having decided that (X)HTML5 was the way to go, the question arose of how to mark up poetry. An obvious first thought is that stanzas (verses) amount to paragraphs, so it seems natural to think in terms of something like this:

<p>Verse 1 line 1<br />
Verse 1 line 2<br />
Verse 1 line 3<br />
Verse 1 line 4</p>

<p>Verse 2 line 1<br />
Verse 2 line 2<br />
Verse 2 line 3<br />
Verse 2 line 4</p>

Blog posts like this one seemed to support this line of thinking. However, further investigation gave pause for thought. In particular, the second reply to this question on stackoverflow seemed particularly relevant, for lines of poetry may be indented in essentially unlimited and arbitrary ways. To accommodate this inconvenient fact it is necessary to mark up each line as a block element in its own right.

In the end what we ended up with was as shown in the example below. We obtain the control we require by applying a CSS style attribute directly to each line that needs to be indented.




Written by Alex Powell

March 18, 2015 at 12:43 pm

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: