How To (Semantically) Mark Up A (Theatre) Script / Play in HTML5?

For obvious reasons, it's hard to search for "play" and "script" without a search engine thinking you mean “play a sound" and “JavaScript".

How can I mark up a script (as in the document one would give to actors in a play) such that it is semantically correct, and easy to style?

For example, let's take the start of Hamlet

Hamlet

ACT I

SCENE I Elsinore. A platform before the castle.

[FRANCISCO at his post. Enter to him BERNARDO]

BERNARDO Who's there?

FRANCISCO Nay, answer me: stand, and unfold yourself.

Fairly obviously, I think, one should start with

<h1 id="title">Hamlet</h1>
<h2 id="act-1">Act 1</h2>
<h3 id="scene-1">Scene 1</h3>

But, then I get stuck.

I've tried looking at MicroData, but Schema.org's CreativeWork[0] really doesn't contain much that would be useful in the case of a work of fiction.

Is it enough just to say

<p class="stage-direction">FRANCISCO at his post. Enter to him BERNARDO</p>
<p id="1"><span class="character bernardo">BERNARDO</span>Who's there?</p>
<p id="2"><span class="character francisco">FRANCISCO</span>Nay, answer me: stand, and unfold yourself.</p>

Or is there a better / more sensible way of doing things?

[0]http://schema.org/CreativeWork

有帮助吗?

解决方案

It seems that the idea of precisely specifying markup for dialogue has been abandoned, and the W3C now simply offers some guidelines which pretty much equate to your idea of using paragraphs and spans.

Note that the dl element, which older sources - including the spec - had formerly recommended, should now definitely not be used: "The dl element is inappropriate for marking up dialogue".

But of course all this might change next week, or month, or year…

其他提示

Does this provide any inspiration? caesar in xml

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top