No description
Find a file
2026-11-04 16:39:45 +01:00
public Transcribe through OpenRouter when OPENROUTER_API_KEY is set 2026-11-04 15:38:24 +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 Transcribe through OpenRouter when OPENROUTER_API_KEY is set 2026-11-04 15:38:24 +00:00
tests Transcribe through OpenRouter when OPENROUTER_API_KEY is set 2026-11-04 15:38:24 +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 Transcribe through OpenRouter when OPENROUTER_API_KEY is set 2026-11-04 15:38:24 +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 Transcribe through OpenRouter when OPENROUTER_API_KEY is set 2026-11-04 15:38:24 +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řidat hru: give the title and pick a photo of each page.
  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. The editor shows the text next to the photos and lists things to check (uncertain words marked [?], characters who speak only once, pages that failed). 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).