Crate sous

Source
Expand description

Library for handling culinary recipes.

This crate provides structs representing various components of a culinary recipe, along with utilities for converting them between various formats.

fn main() {
    let mut recipe = Recipe::new();

    recipe.metadata.name = "Test Recipe".to_string();
    recipe.metadata.author = "Cook Cookerson".to_string();
    recipe.metadata.servings = 2;
    recipe.metadata.cook_minutes = 10;

    recipe.ingredients.push(Ingredient {
        name: "Ingredient".to_string(),
        amount: Some(1.0),
        ..Default::default()
    });
    recipe.steps.push("First step".to_string());
    recipe.steps.push("Second step".to_string());

    let render = MarkdownRenderer::new();
    let md = render.render(&recipe);
}

Structs§

Cookbook
Directory of recipe files.
Ingredient
An ingredient used in a culinary recipe.
MarkdownRenderer
Renders recipes in Markdown format.
Metadata
Container for recipe meta information.
Recipe
A culinary recipe describing how to make a dish.
TemplateRenderer
Renders recipes using a Tera template.

Enums§

SousError
Errors that can occur within Sous.

Traits§

Renderer
A type that can render a recipe to a String.