Screenplay
A script in proper screenplay layout, from text you type the way scripts are written.
What it shows
Lay out a screenplay with a rule for each part of a script, and no Markdown at all.
What you learn
A rule that takes every other line, character cues with their speech indented under them, one look shared through a class, notes in double brackets, cut text that never prints, blank lines kept.
Try this
- Add a line "@TEO" and an indented line under it, and a new speech is set in the middle like the others.
Lost Property
written by
Draft: 9 October 2026
FADE IN:
INT. LOST PROPERTY OFFICE, CENTRAL STATION - NIGHT
Shelves to the ceiling: umbrellas, a cello case, a stuffed giraffe with a luggage tag. The clock over the counter says 11:52.
TEO (20s, a uniform one size too big) stamps the last forms of the day. The bell over the door rings.
MARGOT (70s, good coat, better posture) sets her handbag on the counter like a judge's gavel. She has rehearsed this.
MARGOT
I left something on the 6.15 to Edinburgh.
TEO
Tonight?
MARGOT
(a small smile)
In 1987.
Teo looks at her. Then at the clock. Then back at her.
TEO
We keep things for three months, madam.
MARGOT
Then you will want to look in the back.
Teo takes a torch from the drawer and goes through the door marked STAFF ONLY.
INT. STOREROOM - CONTINUOUS
Dust in the torch beam. Rows of boxes, each with a year in faded marker. Teo walks past 2001, 1995, 1990, and stops at 1987.
He lifts the lid. On top: a pair of red leather gloves, tied together with a ribbon, and a ticket. The name on the ticket is MARGOT ELLERY.
CUT TO:
INT. LOST PROPERTY OFFICE - CONTINUOUS
Teo sets the gloves on the counter. Margot does not pick them up. She touches the ribbon.
MARGOT
(quietly)
He tied that. On the platform. He said I would lose them before Newcastle.
TEO
Did you?
MARGOT
Before Peterborough.
She puts them on. They still fit. The clock ticks over to midnight, and Teo does not reach for his stamp.
THE END
HOW IT'S MADE
Each part of the script is a line rule. A line starting INT. or EXT. is a scene heading, and @NAME is a character cue. The lines indented under a cue are the speech, because the cue's rule has nest.
Every other line is action: the rule with a lone slot matches any line no other rule claims. Notes like this one sit in double brackets, and text between / and / never prints.
set style paper gives the sheet, and set font Courier Prime the typewriter face. One class, script, sets the size for every line.
TRY IT YOURSELF
1. After "Before Peterborough.", add a line @TEO and an indented line under it. A new speech is set in the middle like the others.
2. Change INT. STOREROOM to EXT. STATION YARD. The heading keeps its grey band, because both rules share the class scene.
3. Put a line /* above "Teo looks at her." and a line */ below it. The line leaves the page but stays in the file.
4. Change set font Courier Prime to set font Literata in the rules block. Every line of the script changes typeface.
Next: Song with chords sets chords over lyrics; Org-mode notes reads Emacs Org files.
~~~ selfscribe
# Lesson: Lay out a screenplay with a rule for each part of a script, and no Markdown at all.
# You learn: a rule that takes every other line, character cues with their speech indented under them, one look shared through a class, notes in double brackets, cut text that never prints, blank lines kept.
# Try this: add a line "@TEO" and an indented line under it, and a new speech is set in the middle like the others.
# summary: A script in proper screenplay layout, from text you type the way scripts are written.
# category: writing
# tags: document, simple, creative
# uses: print, markup
set title Screenplay
# Blank lines matter in a script: keep each one as a break.
set blanklines keep
# A script is a typed page: a sheet of paper, in Courier Prime.
set style paper
set font Courier Prime
palette note #f59f00 dark #ffc94d
# Every line of the script is 15px type in the page's font: one look, `script`, that each rule adds to.
class script { font: 15px/1.5 var(--doc-font, "Courier New", Courier, monospace) }
# ---- The title page: "Title:", "Credit:", "Author:", "Draft:", then === for a page break ----
line Title: _ -> div.script.tp-title { margin-top: 1.2em; font-size: 1.6em; font-weight: 700; line-height: 1.3; text-align: center; text-transform: uppercase; letter-spacing: 0.08em } as sp-title
line Credit: _ -> div.script.tp-line { margin-top: 1.2em; text-align: center } as sp-credit
line Author: _ -> div.script.tp-author { text-align: center; font-weight: 700 } as sp-author
line Draft: _ -> div.script.tp-draft keep { margin-top: 2.4em; font-size: 13px; text-align: right; opacity: 0.6 } as sp-draft
line === -> hr { margin: 2em 0; border: 0; border-top: 1px dashed color-mix(in srgb, currentColor 30%, transparent) } as sp-break
# ---- The script: action, scene headings, character cues, parentheticals, transitions ----
# Any line no other rule claims is action: a lone slot matches every line, with the lowest priority.
line _ -> div.script.action { margin: 0; text-indent: 0; text-transform: none } as sp-action
class scene { margin-top: 1.2em; padding: 0.1em 0.5em; border-radius: 3px; font-weight: 700; text-transform: uppercase; background: color-mix(in srgb, currentColor 7%, transparent) }
line INT. _ -> div.script.scene keep as sp-scene
line EXT. _ -> div.script.scene keep as sp-scene-ext
# "@NAME": a character cue. `nest` takes the indented lines under it as the speech.
line @_ -> div.script.character nest { margin: 0.6em 18% 0 20%; text-indent: 24%; text-transform: uppercase } as sp-character
line (_) -> div.script.paren keep { margin-left: 12%; text-indent: 0; font-style: italic; text-transform: none; opacity: 0.8 } as sp-paren
line _ TO: -> div.script.transition keep { margin-top: 0.6em; text-align: right; text-transform: uppercase } as sp-transition
line >_< -> div.script.centered { text-align: center; letter-spacing: 0.1em } as sp-centered
# ---- **bold**, *italic*, _underline_, [[notes]], and /* cut text */ that never prints ----
inline **_** -> strong
inline *_* -> em
inline \__\_ -> u bound
inline [[_]] -> span.note { padding: 0.1em 0.5em; border-radius: 4px; background: color-mix(in srgb, var(--note) 22%, transparent); font: 12px/1.4 var(--doc-font-ui) } as sp-note
block /* ... */ -> hidden verbatim
~~~
Title: Lost Property
Credit: written by
Author: Hana Lindqvist
Draft: 9 October 2026
===
FADE IN:
INT. LOST PROPERTY OFFICE, CENTRAL STATION - NIGHT
Shelves to the ceiling: umbrellas, a cello case, a stuffed giraffe with a luggage tag. The clock over the counter says 11:52.
TEO (20s, a uniform one size too big) stamps the last forms of the day. The bell over the door rings.
MARGOT (70s, good coat, better posture) sets her handbag on the counter like a judge's gavel. [[She has rehearsed this.]]
@MARGOT
I left something on the 6.15 to Edinburgh.
@TEO
Tonight?
@MARGOT
(a small smile)
In 1987.
Teo looks at her. Then at the clock. Then back at her.
@TEO
We keep things for three months, madam.
@MARGOT
Then you will want to look in the back.
/* Cut: Margot tells the whole story here. Let the box tell it instead. */
Teo takes a torch from the drawer and goes through the door marked STAFF ONLY.
INT. STOREROOM - CONTINUOUS
Dust in the torch beam. Rows of boxes, each with a year in faded marker. Teo walks past 2001, 1995, 1990, and stops at *1987*.
He lifts the lid. On top: a pair of red leather gloves, tied together with a ribbon, and a ticket. The name on the ticket is **MARGOT ELLERY**.
CUT TO:
INT. LOST PROPERTY OFFICE - CONTINUOUS
Teo sets the gloves on the counter. Margot does not pick them up. She touches the ribbon.
@MARGOT
(quietly)
He tied that. On the platform. He said I would lose them before Newcastle.
@TEO
Did you?
@MARGOT
Before Peterborough.
She puts them on. They still fit. The clock ticks over to midnight, and Teo does _not_ reach for his stamp.
>THE END<
===
>HOW IT'S MADE<
[[Each part of the script is a line rule. A line starting INT. or EXT. is a scene heading, and @NAME is a character cue. The lines indented under a cue are the speech, because the cue's rule has nest.]]
[[Every other line is action: the rule with a lone slot matches any line no other rule claims. Notes like this one sit in double brackets, and text between /* and */ never prints.]]
[[set style paper gives the sheet, and set font Courier Prime the typewriter face. One class, script, sets the size for every line.]]
>TRY IT YOURSELF<
[[1. After "Before Peterborough.", add a line @TEO and an indented line under it. A new speech is set in the middle like the others.]]
[[2. Change INT. STOREROOM to EXT. STATION YARD. The heading keeps its grey band, because both rules share the class scene.]]
[[3. Put a line /\* above "Teo looks at her." and a line \*/ below it. The line leaves the page but stays in the file.]]
[[4. Change set font Courier Prime to set font Literata in the rules block. Every line of the script changes typeface.]]
[[Next: Song with chords sets chords over lyrics; Org-mode notes reads Emacs Org files.]]