Skip to content

Temperatures

You can declare thermal instructions in your recipes using the ^ symbol.

Gram supports two formats to accommodate both precise baking requirements and qualitative stovetop cooking: Exact temperatures and Semantic temperatures.

Exact temperatures specify a numeric value accompanied by a recognized unit: C or F, case-insensitive, with or without a degree symbol (°C/°F). The compiler normalizes all valid variations to the canonical °C/°F format in its output.

[Preheat] The #oven to ^{180°C}.

[Bake] At ^{350°F} until golden brown.

For stovetop cooking, searing, or subjective heat levels where exact degree values are impractical, you can write qualitative free-text strings:

[Cook] On ^stove{high heat} for ~{2min}.

[Simmer] Turn down to ^{low heat} and let simmer.
v1.5.0

Add a parenthetical note right after the closing brace to specify the oven mode, measurement point, or cooking condition. This works on both exact and semantic temperatures, named or unnamed, just like ingredient preparation notes:

[Preheat] The #oven to ^{320°F}(fan).

[Roast] Until the meat reaches ^{145°F}(internal).

[Cook] On ^stove{high heat}(uncovered) for ~{5min}.

The note is always shown next to the temperature on screen and in print, and is preserved as written in your recipe’s language without being parsed.

As with ingredients and cookware, keep the opening ( attached to } on the same line: with a space (^{350°F} (preheated)), the parentheses remain ordinary step text.

Only Celsius and Fahrenheit temperature scales are supported. The compiler emits structured warnings when encountering malformed temperature values:

  • MISSING_UNIT: Triggered when a numeric temperature is given without an explicit unit (e.g. ^{200}).
  • INVALID_UNIT: Triggered when an unsupported unit is provided (e.g. ^{200K}). The compiler preserves the raw input as written.