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
//! # OSF — Open Screenplay Format Parser
//!
//! A Rust parser for [Open Screenplay Format](https://github.com/OpenScreenplayFormat/osf-sdk)
//! (OSF) files, the native format of [Fade In Pro](https://www.fadeinpro.com) screenwriting
//! software.
//!
//! ## Supported Versions
//!
//! | Version | Attribute Style | Title Page | Notes |
//! |---------|----------------|------------|-------|
//! | 1.2 | `basestylename` | `<info>` attributes | Metadata embedded in `<info>` element |
//! | 2.0/2.1 | `baseStyleName` (camelCase) | `<titlepage>` bookmarks | Separate title page section |
//! | 4.0 | `basestyle` (snake_case) | `<titlepage>` bookmarks | Current version |
//!
//! ## File Format
//!
//! `.fadein` files are ZIP archives containing an XML file called `document.xml`
//! in the Open Screenplay Format. The parser handles both the ZIP container and
//! raw XML input.
//!
//! ## Usage
//!
//! ```no_run
//! // Parse a .fadein file from disk
//! let data = std::fs::read("screenplay.fadein").unwrap();
//! let doc = osf::parse(&data).unwrap();
//!
//! println!("Title: {:?}", doc.title_page.title);
//! println!("Authors: {:?}", doc.title_page.authors);
//! println!("Scenes: {}", doc.scenes.len());
//!
//! for scene in &doc.scenes {
//! println!(" Scene {}: {}", scene.number, scene.heading);
//! }
//! ```
//!
//! ## Raw XML
//!
//! You can also parse raw OSF XML directly:
//!
//! ```
//! let xml = r#"<?xml version="1.0" encoding="UTF-8"?>
//! <document type="Open Screenplay Format document" version="40">
//! <info uuid="test" pagecount="1"/>
//! <settings/><styles/>
//! <paragraphs>
//! <para><style basestyle="Scene Heading"/><text>INT. OFFICE - DAY</text></para>
//! <para><style basestyle="Action"/><text>A desk. A chair.</text></para>
//! </paragraphs>
//! <titlepage/><lists/>
//! </document>"#;
//!
//! let doc = osf::parse(xml.as_bytes()).unwrap();
//! assert_eq!(doc.scenes.len(), 1);
//! assert_eq!(doc.scenes[0].heading, "INT. OFFICE - DAY");
//! ```
pub use OsfError;
pub use *;
pub use parse;