Crate cooklang_reports

Crate cooklang_reports 

Source
Expand description

A Rust library for generating reports from Cooklang recipes using Jinja2-style templates.

Templates are provided with multiple context variables:

  • scale: a float representing the recipe scaling factor (i.e. 1 by default)
  • sections: the sections, containing steps and text, within the recipe
  • ingredients: the list of ingredients in the recipe
  • cookware: the list of cookware pieces in the recipe
  • metadata: the dictionary of metadata from the recipe

For more details about each of these, look through the source for the models module.

Re-exports§

pub use error::Error;

Modules§

config
Configuration struct for report generation.
error
Error types for the cooklang-reports library.
parser
Global parser instance for efficient recipe parsing.

Functions§

render_template
Render a recipe with the deault configuration.
render_template_with_config
Render a recipe to a String with the provided Config.