Recipes

A recipe is a named dish split into servings, built from ingredients that each carry their own nutrition. You log it one serving at a time, and the serving's calories and macros come from what went into the pot.

Import recipe: a Page URL field with a Fetch recipe button, a box to paste ingredients one per line, and a Review ingredients button.

Two ways in

Paste the ingredient list
One ingredient per line, the way recipes are written: "2 large eggs", "1 cup cooked rice", "150 g chicken breast". Give the recipe a name and a number of servings.
Paste a link
The app fetches that one page once and reads the recipe the site publishes for machines (schema.org Recipe data): name, servings, ingredient lines and instructions. Only https links are fetched, pages over 2 MB are ignored, a short list of competitor sites is refused before any request, and nothing is fetched offline. The link, the instructions and the original ingredient text are kept with the recipe.

How a line becomes a food and a weight

Each line is split into a quantity, a unit or portion phrase, and the food. Then:

This is the same algorithm as the project's command-line tool, ported line for line and held to the same acceptance tests.

Review before saving

The review screen shows every line beside the food and gram weight it was matched to. Tap a line to pick a different food; the line is re-matched against that food's portion labels, then its first portion, then 100 g, so it always resolves. Ingredients can also be added from the ordinary food search while editing a recipe.

Weight and nutrition are summed separately

An ingredient counted rather than weighed, such as a scoop with no gram weight behind it, contributes its calories and macros to the recipe but not its grams. Counting a stand-in weight made dishes look heavier than they were and diluted every per-gram figure. The export marks such ingredients so a reader can tell.

Logging a recipe

A recipe appears in food search like any other food, with "1 serving" as its natural portion. Per-100 g values are derived from the totals so other portions work too. Recipes, like custom foods, are always included in an export, whatever timeframe you choose, because a diary is unreadable without the definitions it refers to.

See also: Diary and foods.