Recipe
Store recipes with ingredients, steps, prep and cook times. Total time is calculated automatically.
A recipe template for your personal cookbook. Each Recipe note holds servings, prep time, cook time, difficulty, ingredients, and steps. The total time is calculated automatically when you save.

Downloads
- recipe.rhai — import into Script Manager
- recipe.krillnotes — sample workspace
How to use
- Import
recipe.rhaiin Settings → Scripts → Import Script - Create a new note and choose Recipe as the type
- Give it a title (e.g. the dish name)
- Fill in servings, prep time (minutes), cook time (minutes), and difficulty
- Add ingredients and steps in the text areas
- Save — the total time is computed and displayed automatically
How it works
Recipe schema — on_save hook
On save, the total_time field is computed by adding prep_time and
cook_time. The result is formatted in a human-readable way:
| Total | Display |
|---|---|
| 0 or less | (blank) |
| Under 60 min | e.g. “45 min” |
| 60+ min | e.g. “1h 30min” |
The total_time field is read-only — it cannot be edited directly.
Hover preview
Hovering over a Recipe shows the difficulty, total time, and number of servings.
Schema
schema("Recipe", #{
version: 1,
title_can_edit: true,
fields: [
#{ name: "servings", type: "number", required: false },
#{ name: "prep_time", type: "number", required: false },
#{ name: "cook_time", type: "number", required: false },
#{ name: "difficulty", type: "select", required: false,
options: ["Easy", "Medium", "Hard"] },
#{ name: "ingredients", type: "textarea", required: false },
#{ name: "steps", type: "textarea", required: false },
#{ name: "total_time", type: "text", required: false, can_edit: false },
],
on_save: |note| {
let prep = note.fields["prep_time"];
let cook = note.fields["cook_time"];
let total = (prep + cook).to_int();
set_field(note.id, "total_time",
if total <= 0 {
""
} else if total < 60 {
total.to_string() + " min"
} else {
let h = total / 60;
let m = total % 60;
if m == 0 { h.to_string() + "h" }
else { h.to_string() + "h " + m.to_string() + "min" }
});
commit();
}
});