termcinema-engine 0.1.0

🧠 Core typewriter-style terminal animation engine (SVG renderer) for termcinema
Documentation
/// Content specification: raw text input, unstructured.
///
/// This struct holds the full source text before any parsing.
/// It's the entry point for content-level rendering.
///
/// Used by: tokenizer, layout generator, renderer, etc.
pub struct ContentSpec {
    /// Raw textual content to be rendered (unparsed).
    pub text: String,
}

/// Logical units extracted from script-mode text input.
///
/// This enum represents building blocks of a CLI "story":
///
/// - [`Prompt`]    → e.g. `"user@host:~$"` shell prompt;
/// - [`Command`]   → e.g. `"ls -al"` typed command;
/// - [`Output`]    → e.g. `["file1", "file2", ...]` rendered result.
///
/// Used internally during parsing and grouping stages.
#[derive(Debug)]
pub(crate) enum ScriptBlock {
    Prompt(String),
    Command(String),
    Output(Vec<String>),
}

/// Grouped command entry with associated I/O segments.
///
/// This struct bundles together the prompt, command, and
/// its corresponding output lines as a single renderable block.
///
/// It is the core abstraction unit used in `script` mode playback.
#[derive(Debug)]
pub struct CommandGroup {
    /// Shell-like prompt string (e.g. `"user@host:~$"`).
    pub prompt: String,
    /// Command string typed by user (e.g. `"echo hello"`).
    pub command: String,
    /// Output lines returned by the command.
    pub output: Vec<String>,
}