typesetting the plays

1 scene

The scene text lives in a flowing box that is centered within the view.

It also contains everything that goes in the right margin (which is anchored to it by line). Indeed, everything in the right margin (the resources) will attach at some definite point; whereas everything on the left will be independent of the text itself.

@import colors
@import paper                           // for font in .scene-heading
@import scene
// DUPLICATED in "the speeches"
$interSpeechMargin = 1em

This is the column for the scene text. It includes all of the speeches and stage directions, which must not spill outside of the column. At the same time, it includes all of the marginal content (images, notes, etc), which must be entirely outside of the column (to the right).

	padding 2em $sceneTextMargin
	position relative                       // allow positioning of marginal items (on both sides)

	line-height 1.2

	<<scene typesetting rules>>

2 stage directions

	// Have to revert to this explicitly because speech text is book font
	font-weight 200
	font-size 110%                  // reduces artifacting on light font
	max-width 25em
	margin-bottom $interSpeechMargin
	text-align center

This was to connect parts of speeches that are divided by s.d.’s. It doesn’t quite work because of s.p. indent and margin, so it’s currently excluded.

.speech > .sd:not(:last-child,:first-child)
	border-left .25em solid white
	margin-top 0
	margin-bottom 0
	padding-bottom 1em

s.d. at end of speech, Usually “Exit”

.speech > .sd:last-child
	text-align right

…but not multiple s.d.’s within a speech. Will be few if any after review.

.speech > .sd + .sd
	text-align center               // revert to above

Opening stage directions.

s.d.’s directly contained by scene or speech (i.e., not inline)

> .sd
.speech > .sd
	> .text
		display inline-block
		background #444
		font-weight 200
		color white
		border-radius 3px

		> a
			color white                     // beats path-based defaults
			font-weight normal // most editions use small caps, this looks better

3 speeches

4 speech prefixes

	float left
	font-style normal               // beat "i" default, which is mainly for non-stylesheet viewing
	letter-spacing -.04em
	margin-right .5em
	margin-bottom .2em

	color inherit            // beat link default
	display inline-block // prevents massive repaints from hover background
	// Except that s.p.'s are not links now, so
		cursor inherit

5 roadmap

5.1 TODO support inline formatting

This is for semi-semantic markup—mostly italicization of foreign words. The schema should specify the allowed formatting.

e.g., <i>passado</i> in Rom 3.1.

or, <i>Mi perdonado</i> and <i>Basta</i>, etc in Shr 1.1

Ham 2.1, Videlicet

1H4 2.4 ecce signum

et cetera

5.2 TODO format verse snatches

This is basically a special case of block formatting.

See what the Riverside does, but there are many places where people speak other, usually shorter verse forms, such as the “tree” scene in AYL; Hamlet does this in several places, as do many others. Demarking these would make them more readable.

Of course, they need to be identified first, which is outside of this scope. It’s a judgement call in many cases when this applies. I started adding VERSE in comments, but I’d need some way to collect them generally (at least roughly). Maybe detect a sequence of short lines in the same speech.

[ ] LLL 3.1
Until the goose, a mixed speech
[ ] MND 1.2
all prose except Bottom’s doggerl
[ ] MND 2.2
the fairy song has more detailed arrangement in both F1 and Q1.

5.3 IDEA use continued line indent for s.p. where possible

In other words, when you put in a spacer for a “catch,” why not use that space for the speech prefix?

This breaks down into two cases.

For single continued lines that are inline with the prefix, the width of the s.p. and the spacer are both applied, which generally defeats the purpose of the whole continuation/spacer scheme, except to the extent that most speeches have some s.p.-based offset.

Second, when the speech is long enough that it wraps to its own line (leaving the s.p. on its own line) you could in most cases move the s.p. down into that space.

5.4 IDEA for prose, why not just display inline s.d.’s inline?

In other words, let the first line of the speech indent—was the proposal, I guess?

5.5 TODO short wrapped prose lines use extra whitespace

This is an old note, and my example line no longer wraps in the latest version, unless the screen is very narrow. But I think the issue is related to the one noted in the “dialogs” section of “self documenting” (see the footnote there).

6 issues

6.1 BUG lines following an inline sd (with catch) are not displayed

See, e.g. https://willshake.net/plays/WT/4.4#O_father

Or, https://willshake.net/plays/WT/5.1#I_thought, where it appears to mess up the preceding line as well.

An even more screwed up example: https://willshake.net/plays/Ham/2.2#Ay_so

See also the end of Tmp 5.1, lines after “chuck” are not visible.

Or, see https://willshake.net/plays/TN/1.4#Ill_do, where a line ends up in the wrong place.

6.2 BUG multiple inline s.d.’s don’t display correctly

See https://willshake.net/plays/Tmp/1.2#It_works

That said, I haven’t decided how these should be displayed.

It looks like this may also screw up the spacer for a following catch, see https://willshake.net/plays/Tmp/1.2#Be_of

6.3 BUG some continued lines overflow box

See http://ws/plays/Ham/3.3#We_will_haste

This may be a very unusual case, see the length of the s.p. there (Rosencrantz & Guildenstern).

about willshake

Project “willshake” is an ongoing effort to bring the beauty and pleasure of Shakespeare to new media.

Please report problems on the issue tracker. For anything else, public@gavinpc.com

Willshake is an experiment in literate programming—not because it’s about literature, but because the program is written for a human audience.

Following is a visualization of the system. Each circle represents a document that is responsible for some part of the system. You can open the documents by touching the circles.

Starting with the project philosophy as a foundation, the layers are built up (or down, as it were): the programming system, the platform, the framework, the features, and so on. Everything that you see in the site is put there by these documents—even this message.

Again, this is an experiment. The documents contain a lot of “thinking out loud” and a lot of old thinking. The goal is not to make it perfect, but to maintain a reflective process that supports its own evolution.

graph of the program



An edition of the plays and poems of Shakespeare.

the works