
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
fountain.ts
Advanced tools
A Typescript based parser for the screenplay format Fountain. Source originally from Matt Daly's fountain.js
Fountain-ts is a TypeScript based parser for the screenplay format Fountain. Based on Matt Daly's fountain-js.
The package known as fountain.ts
is being deprecated in favor of fountain-js
. Please visit the fountain-js NPM package for latest versions for this codebase.
Supports up to v 1.1
of the Fountain syntax.
Currently Fountain-ts supports a limited range of key-value pairs for title pages -
Fountain-ts behaves as Fountain-js does. Import Fountain
and create a new instance of it.
import { Fountain } from 'fountain.ts';
The output provided by Fountain-ts is an object literal, a Script
interface, of the format: { title: '...', html: { title_page: '...', script: '...' } }
.
An example.
import { Fountain, Script } from 'fountain.ts';
import * as assert from 'assert';
const text = `.OPENING TITLES
> BRICK & STEEL <
> FULL RETIRED <
SMASH CUT TO:`;
let fountain = new Fountain();
let output: Script = fountain.parse(text);
let actual = output.html.script;
const expected = '<h3>OPENING TITLES</h3><p class="centered">BRICK & STEEL <br /> FULL RETIRED</p><h2>SMASH CUT TO:</h2>';
assert.equal(actual, expected);
Like Fountain-js, if you want access to the tokens that Fountain-ts generates, simply attach a true
parameter to your parse calls. Requesting tokens adds a tokens property to the output generated by Fountain-ts.
let output: Script = fountain.parse(script, true);
console.log(output.tokens);
The tokens for the Brick & Steel sample found on the Fountain website would look as follows (just a small sample):
[
...,
{ type="scene_heading", text="EXT. BRICK'S PATIO - DAY", scene_number="1"},
{ type="action", text="A gorgeous day. The su...emplating -- something."},
{ type="action", text="The SCREEN DOOR slides ...es with two cold beers."},
{ type="dialogue_begin"},
{ type="character", text="STEEL"},
{ type="dialogue", text="Beer's ready!"},
{ type="dialogue_end"},
{ type="dialogue_begin"},
{ type="character", text="BRICK"},
{ type="dialogue", text="Are they cold?"},
{ type="dialogue_end"},
{ type="page_break"},
{ type="dialogue_begin"},
{ type="character", text="STEEL"},
{ type="dialogue", text="Does a bear crap in the woods?"},
{ type="dialogue_end"},
{ type="action", text="Steel sits. They laugh at the dumb joke."},
{ type="dialogue_begin"},
{ type="character", text="STEEL"},
{ type="parenthetical", text="(beer raised)"},
{ type="dialogue", text="To retirement."},
{ type="dialogue_end"},
{ type="dialogue_begin"},
{ type="character", text="BRICK"},
{ type="dialogue", text="To retirement."},
{ type="dialogue_end"}
...
]
Just like Fountain-js, Fountain-ts attaches some extra tokens, such as 'dialogue_begin'
and 'dialogue_end'
. These are used to block together sections.
In the case of dual dialogue, it allows Fountain-ts to attach a dual
property to blocks of dialogue.
FAQs
A Typescript based parser for the screenplay format Fountain. Source originally from Matt Daly's fountain.js
We found that fountain.ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.