From fcde084b2c1c83bf02acf0307f696c987be9946f Mon Sep 17 00:00:00 2001
From: EmmaSweeney
Complete dramatic works are divided into acts, scenes, and sometimes short plays. The se split-file
tool automatically uses prose book file structuring, semantics, and naming conventions. These five easy steps will help you avoid some manual work.
Instead of dealing with chapters, you need to check that your titles for acts, scenes, or short plays are marked with <h2>
elements. Headers are usually incorrect or missing in play transcriptions.
Like novels, we add markers before the <h2>
elements in the source file before splitting.
perl -pi -e 's|<h2|<!--se:split--><h2|g' src/epub/text/body.xhtml
+ The se split-file
tool defaults to a chapter template. To add the correct file semantics, we need to create the template file /src/epub/text/drama-template.xhtml
. If you wish to split the work into acts or scenes, you can copy and paste the following code to your new file:
<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" epub:prefix="z3998: http://www.daisy.org/z3998/2012/vocab/structure/, se: https://standardebooks.org/vocab/1.0" xml:lang="LANG">
+ <head>
+ <title>NUMERAL</title>
+ <link href="../css/core.css" rel="stylesheet" type="text/css"/>
+ <link href="../css/local.css" rel="stylesheet" type="text/css"/>
+ </head>
+ <body epub:type="bodymatter z3998:fiction z3998:drama">
+ <section id="ID" epub:type="chapter z3998:scene">
+ TEXT
+ </section>
+ </body>
+</html>
+ If you have a work that is a collection of short plays, you can use this code:
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" epub:prefix="z3998: http://www.daisy.org/z3998/2012/vocab/structure/, se: https://standardebooks.org/vocab/1.0" xml:lang="LANG">
+ <head>
+ <title>NUMERAL</title>
+ <link href="../css/core.css" rel="stylesheet" type="text/css"/>
+ <link href="../css/local.css" rel="stylesheet" type="text/css"/>
+ </head>
+ <body epub:type="bodymatter z3998:fiction">
+ <article id="ID" epub:type="z3998:drama">
+ TEXT
+ </article>
+ </body>
+</html>
+ Now it’s time for se split-file
to do some heavy lifting. With the help of positional arguments, we can simultaneously change the file names and which file template to use when we split the source file. You can see what arguments are available by running se split-file -h
.
If you are splitting the text into acts, you can use:
+se split-file -f act-%n.xhtml -t src/epub/text/drama-template.xhtml src/epub/text/body.xhtml mv act* src/epub/text/
+ If you are splitting the text into scenes, you can adjust commands to be:
+se split-file -f scene-%n.xhtml -t src/epub/text/drama-template.xhtml src/epub/text/body.xhtml mv scene* src/epub/text/
+ Once we’re happy that the source file has been split correctly, we can remove body.xhtml
and drama-template.xhtml
.
rm src/epub/text/body.xhtml src/epub/text/drama-template.xhtml
+ The <body>
element has the semantic inflection of frontmatter
, z3998:fiction
, and z3998:drama
; the <section>
element has the semantic inflection of z3998:dramatis-personae
.
Most plays have periods after each character description. Make sure to remove the ending periods of each list item, except for abbreviations. The letter case of various speakers can vary widely for stylistic purposes. Convert the speakers’ names and descriptions into sentence cases. Remove any bold, caps, or small-caps styling for personas.
Any descriptions are placed in <p>
elements after the list of speakers and end with periods.
<section id="dramatis-personae" epub:type="z3998:dramatis-personae">
- <h2 epub:type="title">Dramatis Personae</h2>
- <ul>
- <li>
- <p>Don Pedro, Prince of Arragon</p>
- </li>
- </li>
- <li>
- <p>Don John, his bastard brother</p>
- </li>
- ...
- <li>
- <p>Messengers, watch, attendants, <abbr class="eoc">etc.</abbr></p>
- </li>
- </ul>
- <p>Scene: Messina.</p>
-</section>
+
+<body epub:type="frontmatter z3998:fiction z3998:drama">
+ <section id="dramatis-personae" epub:type="z3998:dramatis-personae">
+ <h2 epub:type="title">Dramatis Personae</h2>
+ <ul>
+ <li>
+ <p>Don Pedro, Prince of Arragon</p>
+ </li>
+ </li>
+ <li>
+ <p>Don John, his bastard brother</p>
+ </li>
+ ...
+ <li>
+ <p>Messengers, watch, attendants, <abbr class="eoc">etc.</abbr></p>
+ </li>
+ </ul>
+ <p>Scene: Messina.</p>
+ </section>
+</body>