Skip to main content

lottie_rs/
lib.rs

1// This file is part of Lottie.
2//
3// Copyright (c) 2026  René Coignard <contact@renecoignard.com>
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
18//! # Lottie
19//!
20//! `lottie` is a simple yet powerful Fountain screenplay editor.
21//!
22//! This library exposes the core engine of Lottie, allowing other developers to:
23//! - Parse Fountain documents ([`parser`], [`types`]).
24//! - Generate terminal user interface layouts ([`layout`], [`formatting`]).
25//! - Export scripts to different formats ([`export`]).
26//! - Embed the editor application ([`app`], [`config`]).
27//!
28//! # Architecture
29//!
30//! The pipeline flows as follows:
31//!
32//! ```text
33//! Raw text lines
34//!     → parser::Parser::parse()  → Vec<LineType>
35//!     → layout::build_layout()   → Vec<VisualRow>
36//!     → app::draw() / export::export_document()
37//! ```
38
39#![warn(missing_docs)]
40
41/// The interactive TUI editor application, event loop, and rendering logic.
42pub mod app;
43
44/// CLI argument parsing and runtime configuration loading.
45pub mod config;
46
47/// Plain-text and ANSI export of a laid-out screenplay.
48pub mod export;
49
50/// Inline markdown parsing (`**bold**`, `*italic*`, `_underline_`, notes, boneyard)
51/// and span rendering for ratatui.
52pub mod formatting;
53
54/// Visual layout engine: word-wrapping, indentation, page numbering, scene numbering.
55pub mod layout;
56
57/// Fountain markup language parser that classifies each line as a [`types::LineType`].
58pub mod parser;
59
60/// Core type definitions: [`types::LineType`], [`types::Fmt`], style helpers, and layout constants.
61pub mod types;