Skip to main content

zenith_cli/commands/render/
mod.rs

1//! Pure logic for `zenith render`.
2//!
3//! Public entry points:
4//! - [`to_scene_json`]   — parse → validate → compile → scene JSON string.
5//! - [`to_png`]          — parse → validate → compile → PNG bytes (no assets).
6//! - [`to_png_with_dir`] — like `to_png`, with asset directory, lock, and policy flags.
7//! - [`to_pdf_with_dir`] — parse → validate → compile → PDF bytes (one page).
8//! - [`to_pdf_all_pages_with_dir`] — render every page into one multi-page PDF.
9//! - [`to_png_all_pages`] — render every page to PNG.
10//! - [`to_png_spread`]   — render a two-page spread to PNG.
11//!
12//! All operate entirely on in-memory source text; the caller is responsible
13//! for all filesystem I/O.
14//!
15//! This module is split across concern-grouped submodules:
16//! - `entry`      — the error type, render artifacts, and the public entry points.
17//! - `assets`     — font/asset provider construction and disk-based diagnostics.
18//! - `pipeline`   — shared parse/validate/page-resolution/hash helpers.
19//! - [`data_input`] — load a [`DataContext`](zenith_core::DataContext) from a JSON or CSV file (`--data`).
20
21mod assets;
22pub mod data_input;
23mod entry;
24mod pipeline;
25mod text_source;
26
27#[cfg(test)]
28mod tests;
29
30pub use assets::collect_image_dimension_diagnostics;
31pub(crate) use assets::{
32    build_asset_provider, build_font_provider, collect_missing_asset_diagnostics,
33};
34pub use data_input::{DataInputError, load_data_context};
35pub use entry::{
36    PdfArtifact, PngArtifact, RenderCmdErr, SceneArtifact, SpreadRenderOpts,
37    to_pdf_all_pages_with_dir, to_pdf_with_dir, to_png, to_png_all_pages, to_png_spread,
38    to_png_with_dir, to_scene_json,
39};
40pub(crate) use text_source::resolve_text_sources;