Skip to main content

Module render

Module render 

Source
Expand description

Pure logic for zenith render.

Public entry points:

All operate entirely on in-memory source text; the caller is responsible for all filesystem I/O.

This module is split across concern-grouped submodules:

  • entry — the error type, render artifacts, and the public entry points.
  • assets — font/asset provider construction and disk-based diagnostics.
  • pipeline — shared parse/validate/page-resolution/hash helpers.
  • data_input — load a DataContext from a JSON or CSV file (--data).

Re-exports§

pub use data_input::DataInputError;
pub use data_input::load_data_context;

Modules§

data_input
Data-context loading from JSON or CSV files for zenith render --data.

Structs§

PdfArtifact
Rendered vector PDF bytes plus the compile-stage diagnostics that produced them.
PngArtifact
Rendered PNG bytes plus the compile-stage diagnostics that produced them.
RenderCmdErr
Error produced by the render command.
SceneArtifact
Scene JSON plus the compile-stage diagnostics that produced it.
SpreadRenderOpts
Bundled render options for to_png_spread, keeping its argument count within the lint limit (the spread path also takes two page indices and a gutter override). Copy so it cascades cheaply.

Functions§

collect_image_dimension_diagnostics
Collect image.overflow and image.upscale advisories for all image nodes in the document.
to_pdf_all_pages_with_dir
Parse src, validate it with the merged diagnostic policy, compile EVERY page (in document order, page 1 first), and render them into a single multi-page vector PDF, sourcing image/SVG and font asset bytes from project_dir when provided (exactly like to_pdf_with_dir).
to_pdf_with_dir
Parse src, validate it with the merged diagnostic policy, compile the requested page, and render a vector PDF, sourcing image/SVG and font asset bytes from project_dir when provided (exactly like to_png_with_dir).
to_png
Parse src, validate it, compile the scene, and return PNG bytes.
to_png_all_pages
Parse src, validate it with the merged diagnostic policy, and render EVERY page to PNG, returning one PngArtifact per page in document order (page 1 first).
to_png_spread
Parse src, validate it with the merged diagnostic policy, compile pages page_a and page_b (both 1-based), composite them side by side (A on the left, B on the right), and return the spread PNG bytes plus the merged compile-stage diagnostics.
to_png_with_dir
Like to_png, but sources image and SVG asset bytes from project_dir (the .zen file’s parent directory) when provided, and honours the merged diagnostic policy.
to_scene_json
Parse src, validate it with the merged diagnostic policy, compile the requested page (1-based), and return the scene JSON plus the compile-stage diagnostics.