Skip to main content

render

Function render 

Source
pub fn render(
    ctx: &Context,
    req: RenderRequest,
) -> Result<Outcome<String>, CoreError>
Expand description

Render req’s recipe through req’s template.

Aisle and pantry configuration come from ctx, and both ConfigSource kinds work: a ConfigSource::Path is handed to cooklang-reports to read, and a ConfigSource::Inline is injected directly as the aisle_content / pantry_content template variables that aisled(), excluding_pantry() and from_pantry() look up. The two are equivalent to a template, with one difference worth knowing: a ConfigSource::Path naming a file that cannot be read is not an error — cooklang-reports warns on stderr and carries on as though no aisle or pantry had been given.

§Errors