How this edition was made
Enter Claude.
This edition was produced by transcribing a scanned copy of a printed book, page by page, and rebuilding it as static HTML. This page records exactly how that was done, including the parts that turned out to be harder than expected.
The source
The text comes from a public-domain scan held by the Internet Archive:
The file is a 170-page image PDF of roughly 8.6 MB. Every page is a photograph of paper; there is no digital text in it apart from an automatically generated OCR layer, discussed below.
Two practical obstacles first
The PDF began life in the user's Downloads folder, which macOS protects with its privacy controls (TCC). Every attempt to open it — the file reader, a shell copy, even with the sandbox disabled — returned "Operation not permitted". The fix was simply to place a copy inside the project directory, where no such protection applies.
The second obstacle was that nothing on the machine could turn a PDF page into an image. Poppler was installed for this, which supplies pdftoppm; that is what renders each page so it can be read.
Why the embedded OCR was not used
The PDF carries an OCR text layer, and it is not good enough to publish. A few genuine examples of what it produced:
Scene III. A room in the loalace. (palace) DRAMATIS PERSOX^ (PERSONÆ) Your praise is come too swifty home (swiftly) Confesses that she secretly o'erhard (o'erheard) the arriv^al of Orlando in the Forest (arrival)
Errors like these are silent: they produce real-looking words in the wrong places. For a reading edition whose whole promise is fidelity, that is disqualifying.
The OCR layer was therefore used for one purpose only — as a rough index. Text extraction was fast enough to locate act and scene headings, find where the back-matter notes began, and work out how printed page numbers mapped onto PDF page numbers. None of that text reached the finished pages.
Every word you read in this edition was transcribed by reading the rendered page images directly, one spread at a time.
Mapping the book
Reading a handful of pages established the correspondence between the book's own page numbers and the PDF's:
printed pp. 1–92 play text PDF pp. 31–122 printed pp. 93–133 notes on the play PDF pp. 123–163 printed pp. vii–xx introduction PDF pp. 15–29
The play runs to twenty-two scenes: Act I has three, Act II seven, Act III five, Act IV three and Act V four.
The hard part: how the book numbers its lines
The whole design depends on line numbers, because the editor's notes are keyed to them — a note reading "39. Sir." belongs beside line 39. Reproducing the notes in the margin therefore means reproducing the book's line count exactly. That count follows rules the book never states. They had to be inferred by counting printed lines against the numbers printed in the margins, and they are not the obvious ones:
- In prose, every printed line is numbered — including a line that ends in a
hyphenated word broken across the line ending, such as "there-" / "fore".
- In verse, a turn-over — a verse line too long for the column, whose tail is
carried onto a second printed line — is also numbered.
- But a hemistich is not. When a single verse line is shared between two
speakers, the second speaker's half is printed indented on its own line and takes no number of its own; it belongs to the line above.
- Numbering restarts at 1 in each new scene.
- Stage directions are never numbered.
One further discovery matters for anyone comparing this edition against the original: the book is not perfectly consistent with itself. Its printed marginal numbers and the line numbers used in its own back-matter notes disagree by one in several places. The numbers shown in the margin here follow the printed marginal numbers. The notes, however, are not placed by number at all.
Placing the notes by the word, not the number
Anchoring each note to the line number printed beside it in the back matter is the obvious approach, and it is wrong often enough to be visible. Two things defeat it.
The first is the disagreement just described. From a point in Act I, Scene II onward the editor's note numbers run one ahead of his own margins, so every note from there was landing a line early — and, because the generator looked for the head-word only on the line it had anchored to, the word went unmarked in the text as well. One fault, two symptoms.
The second is that a head-word does not always sit on a single line. The book breaks "this broken / music" across a line ending, and "if you saw yourself with your eyes or knew / yourself with your judgment"; it also hyphenates words at the margin, as in "point-" / "device". No single line contains the phrase, so no search of one line can find it.
So the head-word itself decides where its note goes. For each note the generator searches the lines around the stated number for the words the editor quotes, matching without regard to case, and accepting a match that straddles a line ending — with or without a hyphen, and including the case where the head-word carries a hyphen of its own. The note is then placed beside the line that really holds its head-word, and that head-word is underlined in the text, across both lines when it spans two. Of the 730 notes that quote a head-word, 713 are placed this way.
The seventeen that are not are cases where the editor did not quote his text verbatim: he writes "burthen" where the text has "burden", "stanza" for Touchstone's "stanzo", "clapped him on the shoulder" where the line reads "clapped him o' the shoulder". Those keep the number he gave them and are left unmarked, which is the honest outcome — there is no such word there to mark.
The transcription format
Rather than write HTML by hand, each act was transcribed into a compact plain text format, one file per act, designed to be quick to type accurately and to carry every distinction the printed page makes.
=== SCENE I loc: Orchard of Oliver's House. stage: Enter Orlando and Adam. crit: In the opening scene of As You Like It, the audience is given... --- Orl. As I remember, Adam, it was upon this fashion bequeathed me by will but poor a thousand crowns, and, > Enter Oliver. Oli. Now, sir! what make you here? Ere he should thus have ventured. & Cel. Gentle cousin, Let us go thank him and encourage him: --- notes 1 | upon this fashion | After this fashion. 7 | stays | Detains. | unkept | Without proper food and clothing. 35-7 | | An allusion to the story of the Prodigal Son (Luke xv.).
The conventions are few:
- Each ordinary line of the file is one printed line of the book, and takes the
next line number.
- A line beginning "> " is a stage direction: centred, italic, not numbered.
- A line beginning "& " is a hemistich: indented, and sharing the number of the
line above rather than taking its own.
- Leading spaces are preserved as indentation, which is how songs and the
verse quotations keep their shape.
- After "--- notes", each note is "line number | head-word | gloss". An empty
line number attaches the note to the same line as the note before it, which is how the book itself prints its unnumbered continuation glosses. A range such as "35-7" anchors to the first number in it.
The generator
A single script, build.py, turns those files into the finished pages. It is about three hundred lines of Python using nothing outside the standard library, so it will run on any machine with Python 3 and needs no installation step.
For each act it parses the source file, then walks it emitting HTML. Along the way it recognises and marks up the speaker prefix at the start of a line, so "Orl." can be set in italic small capitals; italicises stage directions that appear inside a line, such as "[Exit Charles.]", while leaving the rest of the line alone; gives every line a stable identifier so it can be linked to; prints a number in the margin every fifth line; and, for each note, underlines the glossed head-word where it occurs in the text and emits the note itself beside the line.
The same script also builds the cover, the navigation bar shared by every page, and this page.
How the sidenotes work
The notes are placed with CSS alone. There is no JavaScript anywhere in this edition — the pages are inert HTML and one stylesheet, and will keep working without change.
The reading column reserves empty space on its right. Each note is floated into that space using the classic trick of pairing a width with a negative right margin that cancels it out:
.sidenote {
float: right;
clear: right;
width: calc(var(--noteratio) - var(--notegap));
margin-right: calc(-1 * var(--noteratio));
}
Because the width and the negative margin differ only by the gap, the note takes up no horizontal room in the text column, so the play text is never narrowed or reflowed around it. "clear: right" makes each note stack below the previous one, so where annotation is dense the notes queue up in order instead of overlapping. Across the whole edition not one of the 798 notes collides with another.
That ratio needs care, and the first version of this stylesheet got it wrong. A percentage width on a float does not resolve against the page, as one might assume, but against the float's containing block — here the content box of the lines container, which is to say the text column itself. The stylesheet reserved a margin of 40% of the page and then set the note to roughly the same figure, which quietly produced a note a little over half as wide as the space set aside for it: 213 pixels of a reserved 379, with the rest left empty against the right edge. The ratio has to be (100 - textcol) / textcol rather than (100 - textcol), and the two values have to be kept in step by hand.
On a narrow screen the reserved margin would leave nothing for the text, so below the breakpoint it is removed and the notes fall inline directly beneath the lines they belong to.
One more rule keeps the scenes apart. A float is not enclosed by its parent unless that parent establishes a block formatting context, so the notes were free to spill out of the bottom of their scene and run into the next one. This is invisible on a wide screen, where a scene's text is always taller than its notes, but obvious on a tall narrow one — an iPad held upright — where the notes need far more height than the text beside them: on Act II three scenes began before the previous scene's notes had finished, one of them overlapping by 136 pixels. Giving the lines container "display: flow-root" makes it grow to enclose its own notes, without clipping them or introducing a scrollbar, so each scene now begins only after the notes of the one before it have ended.
How it was checked
Transcription errors of the dangerous kind are the ones that shift the line count, because they move every note after them. To catch these, a check runs over each act comparing the notes against the text: for every note that quotes a head-word, it looks for that word on the line the note is keyed to. A note whose word is not where it should be signals that the count has drifted.
This is how the hemistich rule was found, and it caught three real faults that reading alone had missed:
- Act II, Scene IV drifted by two lines from the point where Silvius cries "O
Phebe, Phebe, Phebe!" — the book runs that exclamation onto the previous line rather than numbering it separately.
- Act III, Scene II drifted by two at the line "Cel. [Reads]", a bare speech
prefix introducing the poem, which the book does not count as a line.
- Act V, Scene II drifted the other way, by two, because the antiphonal
exchange "And I for Ganymede / And I for Rosalind / And I for no woman" had been treated as shared half-lines when the book in fact numbers each one.
After correction the check is clean. The handful of entries it still reports are the seventeen described earlier, where the editor's wording simply differs from the text he is glossing.
What is here, and what is not
Included: the complete text of all five acts, and from the editor's back-matter the line-by-line glosses, set as margin notes, together with the short critical comment that opens his notes on each scene, set as a callout at the head of the scene.
Left out: the study questions printed after each scene, the per-act reviews, the appendix of departmental and matriculation examination papers, and the introductory essay on Shakespeare's life, theatre and metre. These are schoolroom apparatus of 1908 rather than part of the reading experience.
Fidelity
Spelling, punctuation and line breaks are the book's own and have not been modernised. Where the printer erred, the error stands; a reproduction that quietly corrects its source cannot be checked against it. So Celia still says "Your have simply misused our sex", Silvius still says "Thou has not loved", and at Act IV Scene III the speech prefix for Oliver's entrance still reads "Orl." as it does on page 73.
The edition in numbers
Act Scenes Numbered lines Notes Act I 3 581 166 Act II 7 547 196 Act III 5 707 207 Act IV 3 385 108 Act V 4 442 121 ---------------------------------------------- Total 22 2,662 798
Also 43 hemistichs and 51 free-standing stage directions. Of the 798 notes, 730 quote a head-word and 713 of those are matched to it in the text and underlined there; the remaining 68 are pure paraphrase, with no word to mark. The transcription sources come to about 177 kB of plain text.
Rebuilding it
Everything needed to regenerate the site is in the project directory. The transcriptions live in data/, as one .src file per act plus this page; build.py reads them and writes the HTML; assets/styles.css is the single stylesheet.
python3 build.py
That rewrites index.html and every chapter page. The result is a set of plain files that can be opened straight from disk — no server, no build tooling, no network access, and nothing to install.