Crates.io | scripter |
lib.rs | scripter |
version | 0.4.1 |
source | src |
created_at | 2019-07-23 22:25:37.990614 |
updated_at | 2019-10-08 21:32:01.780336 |
description | A screenplay compiler |
homepage | |
repository | https://github.com/jstasiak/scripter |
max_upload_size | |
id | 151174 |
size | 30,007 |
A screenplay compiler.
There's a nice screenplay LaTeX package but using it is not particularly convenient, as the code gets quite verbose.
Instead let's use an ad-hoc minimal script language and transpile to TeX.
INT.
or EXT.
are treated as sluglines, what
comes after INT.
and EXT.
is free-form:
character. The part before the first colon is
is the character that's speaking, the second is what's being said. Parts in
parentheses are treated as parentheticals. Colon characters other than the
first are treated as plain text.Input:
The Alienant, version 1
Firstname Lastname
INT. SPACE STATION
Dark corridor. Something lurks in the shadows.
EXT. MILITARY BASE -- DAY
COLONEL SMITH smokes a cigarette. There are items on his desk: a bottle of whisky, a gun and a doll. SMITH looks up as CAPTAIN PARKER approaches.
CAPTAIN PARKER doesn't look too well.
SMITH: So, it's begun.
PARKER: Yes. (inhales) Yes, it has.
SMITH: I was afraid it'd come to this. Look: how about we –
PARKER: No.
SMITH: But & % $ # _ { } ~ ^ \
PARKER: Hold on, what?
TeX output:
\documentclass{screenplay}
\usepackage[T1]{fontenc}
\usepackage[polish]{babel}
\usepackage[utf8]{inputenc}
\title{The Alienant, version 1}
\author{Firstname Lastname}
\begin{document}
\coverpage
\fadein
\intslug{SPACE STATION}
Dark corridor. Something lurks in the shadows.
\extslug{MILITARY BASE -- DAY}
COLONEL SMITH smokes a cigarette. There are items on his desk: a bottle of whisky, a gun and a doll. SMITH looks up as CAPTAIN PARKER approaches.
CAPTAIN PARKER doesn't look too well.
\begin{dialogue}{SMITH}So, it's begun.\end{dialogue}
\begin{dialogue}{PARKER}Yes. \paren{inhales} Yes, it has.\end{dialogue}
\begin{dialogue}{SMITH}I was afraid it'd come to this. Look: how about we –\end{dialogue}
\begin{dialogue}{PARKER}No.\end{dialogue}
\begin{dialogue}{SMITH}But \& \% \$ \# \_ \{ \} \textasciitilde{} \textasciicircum{} \textbackslash{}\end{dialogue}
\begin{dialogue}{PARKER}Hold on, what?\end{dialogue}
\fadeout
\theend
\end{document}