cook.md

Report Templates

A report template is a plain-text Jinja file that turns your .cook recipes and .menu plans into a rendered document — a shopping list, a nutrition breakdown, a week-at-a-glance summary. Templates are just files in your recipe folder, and Cook Editor renders them for you.

What you can build

  • Shopping lists — grouped by aisle, with checkboxes, from a recipe or a whole week.
  • Nutrition reports — calories, macros, vitamins and allergens per recipe or per plan.
  • Dietitian-style checks — assert "protein over 75 g, saturated fat under 20 g" and get a pass/fail summary.
  • Anything text — templates output Markdown, HTML, or plain text, so labels, meal-prep cards and cost sheets are all fair game.

How rendering works

Open a .cook or .menu file in Cook Editor and run Cooklang: Render Report… from the command palette (or right-click in the open file). The editor lists every template in your folder plus two built-ins — Ingredients List and Shopping List — renders your pick in a side panel, and lets you print it or export it as PDF or PNG.

The template's file name decides the output: report.md.jinja (or a plain report.jinja) renders as Markdown, report.html.jinja as HTML, and other inner extensions as plain text.

Two ways to get data into a report

Every template sees your recipe's ingredients out of the box. For data beyond the recipe itself, there are two routes:

  • Your own local database — free. Keep a db/ folder of YAML files next to your recipes (densities, prices, shelf lives, even nutrition facts you enter yourself) and read it with the db() function. You maintain the data; it lives in plain text on your disk like everything else.
  • Cook Pro nutrition functions. nutrition_for() and friends look ingredients up in a curated nutrition database built from USDA and other reference sources, with unit and preparation conversion, allergen data, and honest confidence reporting. This needs a Cook Pro subscription — if you'd rather save the money, the local db() route works with any template.

Next steps