Skip to main content

Module render

Module render 

Source
Expand description

PDF rendering for transformed Markdoc documents.

Three-pass pipeline:

  1. layout ([block::layout_document]) — walk the rendered tree, lay out each block via parley, return a flat Vec<Block> with heights baked in.
  2. paginate ([paginate::paginate]) — greedy split of blocks into pages so the running height stays under the page budget.
  3. emit ([emit::emit_blocks]) — open one krilla page per group and draw the blocks.

Re-exports§

pub use style::FrontmatterColumn;
pub use style::FrontmatterTable;
pub use style::Style;
pub use style::StyleLoadError;

Modules§

style
Document style spec.

Structs§

ExternalTagref
Website destination for a {% tag %} that is not in the PDF.
RenderContext
Caller-supplied context that the renderer can interpolate into header/footer template strings and surface as PDF document metadata.

Enums§

RenderError
Render a transformed Markdoc tree to PDF bytes using the given style. Media references resolve through the null resolver (placeholder text); for documents that contain images, use render_pdf_with_assets. Errors surfaced by the final PDF serialisation pass. Layout itself is infallible by construction; krilla defers image stream encoding to finish(), so a corrupt embedded asset surfaces here — as an error the CLI reports cleanly, not a panic.

Functions§

render_pdf
render_pdf_with
Full-control entry: caller provides assets resolver and RenderContext (used for header/footer template substitution like {title}).
render_pdf_with_assets
Render with a caller-supplied asset resolver. Equivalent to render_pdf_with with a default RenderContext.