Skip to main content

print_human

Function print_human 

Source
pub fn print_human(
    recipe: &Recipe,
    name: &str,
    scale: f64,
    converter: &Converter,
    style: Style,
    writer: &mut impl Write,
) -> Result<(), Error>
Expand description

Write a recipe as the text cook recipe prints.

name is the title to show, scale is appended to it when it is not 1.0, and converter supplies the units used to group quantities.

style decides whether ANSI escape codes survive. The rendering below always paints, so Style::Plain is Style::Ansi with the escapes removed, character for character.