Cooklang Export
Cooklang is a wonderful human-first recipe markup language. Foodlang treats it as a friendly export target — when you want the most readable, app-compatible version of a recipe, compile to Cooklang.
Compile
foodlang compile examples/simple-latte.food.yaml --target cooklang
---
title: Simple Latte
servings: 1
tags: [coffee, latte]
---
Grind 18 g of coffee for espresso.
Brew a double espresso using about @water{40%mL}.
Steam @milk{220%mL} until silky and hot.
Pour steamed milk into espresso and top with foam.
Lossy by design
This export is illustrative and lossy — and that's the point. Cooklang is
the human layer: it intentionally drops the transformation graph, appliance
parameters, and robot actions, keeping only what a cook needs to read. Foodlang
annotates the first textual occurrence of each ingredient with Cooklang's
@name{amount%unit} syntax.
Why round-trip through Foodlang?
- Author once in
.food.yaml, export readable Cooklang for sharing. - Keep the executable metadata (transformations, appliance targets, robot graph) in the same file, ignored by Cooklang tools.
- Publish the same recipe to the web (Schema.org), appliances (OPC UA/MQTT), and robots (action graph/PDDL/FOON) from one source.
Foodlang does not replace Cooklang. It respects it, and hands it the human layer.