Skip to main content

Crate rustwell

Crate rustwell 

Source
Expand description

This crate is an implementation of the Fountain screenplay markup language specification, and acts as a tool for parsing and exporting the Fountain language to different kinds of formatted documents, such as html and pdf.

The crate can be used both for the whole compilation process, but also as an intermediary step for parsing Fountain text into an abstract syntax tree (AST) that can then be used when constructing new exporters.

§Examples

use rustwell::{Exporter, ExporterExt, HtmlExporter};
use rustwell::parse;

let script = r#"
Title: Example Screenplay

INT. HOUSE – DAY

Someone is knocking on the door.

GUEST
(tired)
Hey, open up!
"#;

let parsed = parse(script);
let exporter = HtmlExporter { ..Default::default() };

exporter.export_to_stdout(&parsed).unwrap()

Re-exports§

pub use screenplay::Screenplay;

Modules§

rich_string
This module implements a RichString, meaning a rich string which can have multiple attributes for style, and can have these on different parts of the same string.
screenplay
This module implements the Screenplay AST with all the components of a screenplay, to be easily exported to any format.

Structs§

HtmlExporter
A Screenplay exporter for HTML
PaperSize
Dimensions of a paper in points (pts).
PdfExporter
A Screenplay exporter for pdf

Constants§

A4
The size of an A4 paper in points (pts).
LETTER
The size of a US letter paper in points (pts).

Traits§

Exporter
A Screenplay exporter.
ExporterExt
An extension trait for Exporter providing common functionality.

Functions§

parse
Parses a Fountain source string into a Screenplay structure.
parse_reader
Parses a Fountain source file into a Screenplay structure.