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
//! Rendering orchestration module for `termcinema`.
//!
//! This module coordinates the full rendering pipeline,
//! including input resolution, theme application, layout generation,
//! and SVG rendering. It supports both CLI and SDK usage.
//!
//! It includes:
//! - Input loading from `--input`, `--script`, or stdin
//! - Escape sequence processing (unless `--no-escape`)
//! - Theme resolution with CLI patching
//! - Layout construction from dimensions and alignment
//! - Final SVG rendering via `termcinema-engine`
//!
//! For SDKs and embedders, [`render_svg_direct`] provides a simplified entrypoint.
pub use print_font_families;
pub use load_input;
pub use write_svg;
pub use resolve_plain_text;
pub use ;
pub use crateavailable_theme_names;
use crateCliArgs;
use crate;
use exit;
/// Entrypoint for CLI execution.
///
/// Called by the `main.rs` binary. Delegates to [`handle_render`] to
/// run the complete rendering pipeline: input → theme/layout → SVG → output.
///
/// Prints any fatal error to stderr and exits with code 1.
pub
/// SDK-friendly rendering entrypoint.
///
/// This function is designed for programmatic use, such as:
/// - WASM bindings
/// - Python FFI
/// - Embedded browser demos
///
/// It skips all CLI-specific input logic (stdin, `--input`, `--script`),
/// and directly renders an SVG from a raw input string + [`CliArgs`] config.
///
/// Script mode is disabled internally, and only layout/style-related fields are respected.
///
/// # Arguments
/// - `raw`: Raw input text (e.g. `"echo hello\\nworld"`)
/// - `args`: CLI-style arguments (theme, font, layout, etc)
///
/// # Returns
/// - `Ok(svg_string)` on success
/// - `Err(...)` if any step fails (invalid theme, layout error, etc)