1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! This crate is an implementation of the [Fountain](https://fountain.io/) 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()
//! ```
use Read;
pub use Screenplay;
pub use Exporter;
pub use ExporterExt;
pub use HtmlExporter;
pub use A4;
pub use LETTER;
pub use PaperSize;
pub use PdfExporter;
/// Parses a Fountain source string into a [Screenplay] structure.
///
/// Preprocesses the source text by removing
/// comments and normalizing tabs to spaces.
///
/// # Examples
///
/// ```
/// use rustwell::parse;
///
/// let input = r#"
/// Title: Example Screenplay
///
/// INT. ROOM – DAY
/// A man stands alone.
/// "#;
///
/// let screenplay = parse(input);
/// assert!(screenplay.elements.len() > 0);
/// ```
/// Parses a Fountain source file into a [Screenplay] structure.