No description
Find a file
agent debf1aa8bc Edit plays page by page, with a review of uncertain words
The editor shows one original page next to its photo, with a page list,
page number and missing toggle, and highlights {uncertain} words. The
review dialog steps through them with the photo zoomed to about the
right line. Pages can be re-read from their photo or added from a new
photo, which fills a !N missing marker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gVRDXpoukzgMFumoJt
2026-11-04 16:15:27 +00:00
public Edit plays page by page, with a review of uncertain words 2026-11-04 16:15:27 +00:00
seed/hra-1931 Let people add plays from photos; library, editor, compose; full-page PDF 2026-11-03 09:43:32 +00:00
server Sort pages by their number, drop repeated photos, mark uncertain words 2026-11-04 16:15:27 +00:00
tests Sort pages by their number, drop repeated photos, mark uncertain words 2026-11-04 16:15:27 +00:00
tools Add theater reader web app with the 1931 play transcription 2026-10-29 23:14:19 +00:00
.dockerignore Let people add plays from photos; library, editor, compose; full-page PDF 2026-11-03 09:43:32 +00:00
.env.example Transcribe through OpenRouter when OPENROUTER_API_KEY is set 2026-11-04 15:38:24 +00:00
.gitignore Let people add plays from photos; library, editor, compose; full-page PDF 2026-11-03 09:43:32 +00:00
AGENTS.md Edit plays page by page, with a review of uncertain words 2026-11-04 16:15:27 +00:00
docker-compose.yml Transcribe through OpenRouter when OPENROUTER_API_KEY is set 2026-11-04 15:38:24 +00:00
Dockerfile Let people add plays from photos; library, editor, compose; full-page PDF 2026-11-03 09:43:32 +00:00
package-lock.json Let people add plays from photos; library, editor, compose; full-page PDF 2026-11-03 09:43:32 +00:00
package.json Let people add plays from photos; library, editor, compose; full-page PDF 2026-11-03 09:43:32 +00:00
README.md Edit plays page by page, with a review of uncertain words 2026-11-04 16:15:27 +00:00

Divadelní čtečka (theater reader)

A small web app for reading play scripts during rehearsals.

Reading (anyone):

  • a library of plays to choose from,
  • choose a font (typewriter, Atkinson Hyperlegible, Lexend, Literata or the system font), the text size and colours (light, sepia, dark),
  • pick your character: your lines are highlighted and ▲ ▼ (or J / K) jump between them,
  • running text (hyphenation joined, spacing tidied) or the original typescript lines,
  • reading mode (settings hidden), or export a PDF of your own copy: A4 sheets filled edge to edge at the size you chose, your lines highlighted. It goes through the print dialog, so choose "Save as PDF".

A link like read.html?hra=hra-1931&postava=Lída opens a play with the character already chosen, so a director can send each actor their own link.

Adding plays (anyone with the upload password):

  1. Přihlásit (top right) with the upload password, then + Přidat hru: give the title and pick a photo of each page. The same photo picked twice is skipped.
  2. Each photo is read by a vision model, through OpenRouter (default google/gemini-3.1-flash-lite) or the Anthropic API (claude-haiku-5-5), and turned into the script markup: speakers, stage directions, page numbers. Missing pages are noticed from gaps in the page numbers.
  3. Pages are put in order by the page number on each photo, so upload order doesn't matter, and a page photographed twice is used once (the clearer transcription wins; the editor lets you switch to the other one).
  4. The editor shows one page at a time next to its photo. Words the model wasn't sure of are highlighted, and Projít nejistá slova steps through them one by one with the photo zoomed to about the right line: Enter accepts, a click picks the model's other reading. A page that failed or a page found later (+ Z fotky, which fills a !7 "missing" marker) can be transcribed on its own. Fix, tick Zveřejněno, save.

Deploying

cp .env.example .env && chmod 600 .env   # then fill in the two secrets
docker compose up -d                     # or: podman compose up -d

The app listens on port 3010 on loopback (PORT and BIND_ADDRESS change that). Plays and photos are kept in the plays volume. On first start the volume is seeded with the 1931 play.

Variable
OPENROUTER_API_KEY Key from openrouter.ai (prepaid credit). Used for transcription when set.
OPENROUTER_MODEL Any OpenRouter model that accepts images. Default google/gemini-3.1-flash-lite (about $0.0015 a page). google/gemini-2.5-flash-lite is cheaper. anthropic/claude-haiku-5.5 and google/gemini-3.5-flash are alternatives if pages come out badly.
ANTHROPIC_API_KEY Instead of OpenRouter: an API key from platform.claude.com. A Claude Pro/Max subscription can't be used for this. The API is billed separately.
Without either key the app still works, but uploaded pages have to be typed up by hand.
UPLOAD_PASSWORD Shared password for adding, editing and deleting plays. Unset = uploading switched off.
CLAUDE_MODEL With the Anthropic key: claude-haiku-5-5 (default, around $0.001 a page) or claude-sonnet-5-5 (reads hard pages better, roughly 20× the price).
DAILY_PAGE_LIMIT Cap on pages transcribed per day, for all users together (default 300), so a leaked password can't run up a bill.
MAX_PAGES Maximum photos per play (default 80).

Without compose: docker build -t theater-reader . && docker run -d -p 127.0.0.1:3010:8080 -v plays:/data --env-file .env theater-reader.

The play included

seed/hra-1931/play.txt is a transcription of a 1931 typescript, pages 5–27. Pages 1–4 (probably the title page and cast list) and page 7 are missing from the original, and the text breaks off at the end of page 27. Once deployed, the play is edited in the app. The seed file is only copied into an empty volume.

Fonts are self-hosted under the SIL Open Font License (see public/fonts/OFL-*.txt).