cook.md

Meal Plan Reports

Render a report against a .menu file in Cook Editor and the template receives a plan value: the week broken into days, meals and recipes, with every ingredient list already scaled.

Menus are the meal plans you write in Cook Editor. Each section of the menu (= Day 1 (2026-03-04) =) is a day, and a line ending in a colon (Dinner: or Breakfast (08:30):) starts a meal. The plan value exists only in the editor: released CookCLI (0.41.1) renders a .menu with cook report as a plain recipe, with no plan value and no nutrition functions.

{{ plan.start_date }} – {{ plan.end_date }}
{{ plan.total_meal_count }} meals · {{ plan.unique_recipe_count }} unique recipes

{% for day in plan.days %}
## {{ day.date }}
{% for meal in day.meals %}{% for recipe in meal.recipes %}
- {{ recipe.name }}
{% endfor %}{% endfor %}
{% endfor %}

Fields: plan.days, plan.all_ingredients, plan.total_meal_count, plan.unique_recipe_count, plan.start_date, plan.end_date, plan.servings and plan.missing_recipes. Each day exposes day.date, day.name, day.meals and day.ingredients; each meal exposes meal.meal_type, meal.time and meal.recipes; each recipe exposes recipe.name, recipe.scale and recipe.ingredients.

  • day.date is the YYYY-MM-DD date written in brackets in the section title, and day.name is the whole title. plan.start_date and plan.end_date are the earliest and latest of those dates. The three dates are empty when the menu has none.
  • meal.meal_type is the meal's heading without the colon and the time (Breakfast); meal.time is the HH:MM written in brackets, when there is one.
  • recipe.scale is the factor applied to the recipe: {3%servings} on a recipe that serves 6 gives 0.5.
  • An ingredient in any of the lists has name, quantity.value, quantity.unit and note.
  • plan.servings is the servings number from the menu's front matter (the people the plan feeds), when it is a number.
  • plan.missing_recipes lists the recipe references that could not be read, each with name and error. Their ingredients are missing from every total, so print this list in any report that adds things up:
{% for m in plan.missing_recipes -%}
- Not counted: {{ m.name }} ({{ m.error }})
{% endfor %}

Weekly totalsCook Basic & Pro

plan.all_ingredients is the flat, scaled list for whole-plan aggregation, and day.ingredients gives you the same per day:

{% set wk = aggregate_nutrition(plan.all_ingredients) %}
Week: {{ wk.totals.macros.kcal }} kcal · {{ wk.totals.macros.protein_g }} g protein

{% for day in plan.days %}
{% set t = macros(day.ingredients) %}
{{ day.date }}: {{ t.kcal }} kcal
{% endfor %}

Allergens and confidence work the same as for a single recipe — wk.allergen_summary with the "allergens" include, and wk.confidence_breakdown; see the nutrition reference. In aggregate_nutrition results the macros sit under totals.macros; macros() returns them directly.

These calls go to the nutrition service, and the requests count against your nutrition API daily quota. The guide Make a nutrition report for a meal plan has a complete template.

Variety checksCook Basic & Pro

category_servings(plan, slug) counts the meals containing at least one ingredient in a category (tree-aware), which powers targets like "two servings of oily fish a week":

{% import "ck" as ck %}
{{ ck.between(category_servings(plan, "omega3_source"), 2, 14, "Omega-3 servings") }}

Combine with the ck macros for a full week-in-review report that ends in a pass/fail summary.