Template:Simple script
| This template uses TemplateStyles: |
A simple-to-use template for formatting scripts with CSS instead of tables.
This is particularly good for scripts with long character names (especially when reading on a narrow screen), as well as for improving accessibility and semantic accuracy.
It can be seen in action at The Importance of Being Earnest (Samuel French).
Usage
[edit]Basics
[edit]Example
{{simple script| Algernon. | How are you, my dear Ernest? What brings you up to town? }}
{{simple script| Jack. | Oh, pleasure, pleasure! What else should bring one anywhere? Eating as usual, I see, Algy! }}
{{simple script| Algernon. | ''[Stiffly.]'' I believe it is customary in good society to take some slight refreshment at five o'clock. Where have you been since last Thursday? }}
{{simple script| Jack. | ''[Sitting down on the sofa.]'' Oh, in the country. }}
Split template
[edit]For text continuing over a page break, use the {{simple script/s}}, {{simple script/m}}, and {{simple script/e}} templates
Example
{{simple script| Algernon. | What on earth do you do there? }}
{{simple script/s| Jack. }} ''[Pulling off his gloves]'' When one is in town one amuses oneself.
{{simple script/e}}
{{simple script/m}}
When one is in the country one amuses other people; it is excessively boring.
{{simple script/e}}
{{simple script| Algernon. | How immensely you must amuse them! }}
CSS styling
[edit]{{Simple script}} is intended to be used with page styles; it provides the classes .wst-simple-script and .wst-charname, and the optional class parameter can be used to add custom classes.
Example
The structure of the HTML output is:
<div class="wst-simple-script _custom-classes-are-here">
<p>
<span class="wst-charname">
The character's name
span>
What the character says.
p>
<p>
If third parameter is used, value goes here
p>
div>
The default styling is:
.wst-simple-script p {
text-indent: -2em;
margin-left: 2em;
}
.wst-simple-script p + p {
text-indent: 0;
}
.wst-charname {
padding-right: 0.5em;
}
The default styling looks like
Example
Algernon. How are you, my dear Ernest? What brings you up to town?
Jack. Oh, pleasure, pleasure! What else should bring one anywhere? Eating as usual, I see, Algy!
Algernon. [Stiffly.] I believe it is customary in good society to take some slight refreshment at five o'clock. Where have you been since last Thursday?
Jack. [Sitting down on the sofa.] Oh, in the country.
The CSS to mimic some common typesetting styles is provided; to use, copy and paste the relevant rule to the style page of the Index. The "fake table" group of rules is designed to look like a table while allowing longer character names to overflow.
Example
/* for small caps */
.wst-charname {
font-variant:small-caps;
}
/* for all-small-caps */
.wst-charname {
font-variant: all-small-caps;
}
/* for bold */
.wst-charname {
font-weight: bold;
}
/* for fake table */
div.wst-simple-script { margin-left: 4em; }
.wst-simple-script p { text-indent: -4em; margin-left: 0; }
.wst-charname { min-width: 4em; text-indent: 0; display: inline-block; }
.wst-charname::after { content: "\2002" }
Known issues and workarounds
[edit]Line breaks
[edit]Sometimes, the template gets confused by line breaks and treats them as separate paragraphs.
Example
{{simple script | John | In this example,
the OCR engine has kept the original line
breaks that are in the source text. }}
You can put everything on one line, but if you don't want to do that, this method also works:
{{simple script | John | {{span|text=In this example,
the OCR engine has kept the original line
breaks that are in the source text.}} }}
Template data
[edit]For formatting scripts
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| 1 | 1 | The name of the character
| String | required |
| 2 | 2 | What the character says
| String | required |
| 3 | 3 | To add a second paragraph (use after {ppoem}) | String | optional |
| class | class | Any additional CSS classes
| String | optional |