Just finished my own overthinking of recipe structures.
I figure that a recipe is more or less an upside-down tree!<p>Where you start with a list of all the nodes (ingredients)<p>Have a n:1 relationship with the next series of nodes (steps)<p>until you finish at a single node (the dish you're trying to make)<p>So instead of having a separate chunk of "here's my ingredients" and "let me repeat the ingredients and one by one instruction until the end" I figure you can display the upside-down tree to convey more information with less words.<p>An example being <a href="https://cookbook.cstebbins.com/recipe/bul-koki" rel="nofollow">https://cookbook.cstebbins.com/recipe/bul-koki</a><p>With the underlying tree structure looking like <a href="https://assets.cstebbins.com/cookbook/images/bulkokiTree.png" rel="nofollow">https://assets.cstebbins.com/cookbook/images/bulkokiTree.png</a>
I find "higher level" format issues to be of greater concern. These are issues like: is the recipe structured in a way that makes the prep/process flow clear, makes it obvious when a certain ingredient needs to be prepped but divided into multiple parts for use in different stages, or when different stages lead to products that are combined and subsequent poisons in the workflow?<p>A recent example: I really like the Hainanese chicken recipe at <a href="https://www.google.com/amp/s/amp.theguardian.com/food/article/2024/may/11/yotam-ottolenghi-five-ingredient-or-thereabouts-recipes-chicken-rice-spring-onion-broad-beans" rel="nofollow">https://www.google.com/amp/s/amp.theguardian.com/food/articl...</a> ... But I find it very hard to follow in this format.<p>Using o1-preview to restructure it, I get something that I find much easier to follow during my cooking workflow: <a href="https://chatgpt.com/share/6733e594-df28-8009-ac80-d5dabd1ae01b" rel="nofollow">https://chatgpt.com/share/6733e594-df28-8009-ac80-d5dabd1ae0...</a><p>But getting from a well-written recipe to structured data is now pretty straightforward... if/when you need structure data.
Many years ago I experimented with making recipes into Gantt charts. For more complex recipes this proved incredibly useful. I spent some time trying to automate turning some of the recipe formats into Gantts, but it was pretty cumbersome. I'll bet a good LLM would make this achievable now.<p>For an example, here's a gantt chart for Beef Bourguignon:<p><a href="https://ibb.co/c3TVTnX" rel="nofollow">https://ibb.co/c3TVTnX</a><p>Note that when I print it on a (physical) recipe card, I have the 'prose' instructions underneath.<p>I still think this is a pretty good idea, and I still use the cards for this recipe, and Beef Wellington.
I've also spend a bit of time thinking about recipe formats because I wanted to write down some recipes for my website. Ended up making a custom yaml-based format after looking at the available options and after a while scrapped that again to make a new toml-based format to make it a bit easier to write.<p>The format is pretty well demonstrated at <a href="https://git.sr.ht/~martijnbraam/fathub-data/tree/master/item/en/recipes/indonesian/main/mie-goreng.toml" rel="nofollow">https://git.sr.ht/~martijnbraam/fathub-data/tree/master/item...</a> which renders to <a href="https://fathub.org/en/recipe/indonesian/main/mie-goreng.html" rel="nofollow">https://fathub.org/en/recipe/indonesian/main/mie-goreng.html</a><p>Some notable features is a mini DSL to refer to ingredients in the instruction text and also have parse-able times and temperatures so on the frontend it's easy to switch units with javascript. This is combined with a simple database of ingredient IDs which contains (translated) names and for some of them the density so you can swap the recipe between volume and weight measurements.
Here's my favorite format, which my sister and I made. It doesn't work well for all recipes, but it does for lots of them. Minimizes words, easier to visualize steps.<p><a href="https://imgur.com/a/RDO6j6H" rel="nofollow">https://imgur.com/a/RDO6j6H</a>
The replies to this post are, unfortunately, very indicative of the negative side of the "(pseudo-)engineering mindset", which is rather close to the model-constructing mindset inherited from economics (reductionism, hiding any variety incurred by real world complexity, etc).<p>I don't see very many people here who seem to really have done a lot of cooking, consider it a serious hobby or profession, etc.<p>None of these proposals pass the smell test as being able to capture anything beyond the most basic of recipes.
It seems written by someone that does not cook, it is missing a lot of informations!<p>In particular, the cooking time is completely useless without the heat power and the kind of pan, and conversions between pans
I’ve recently been caught up on noodling on the combinatorics of cooking food. I wonder if a structured recipe format would be helpful to explore the ‘solution space’ of any given dish.<p>For example, think of all the decisions required to specify a curry dish:<p>How do you cut/mash your garlic and ginger and onions? (If you even add all of those ingredients)<p>Do you use whole or ground spices? What about for each spice? Cardamom pods or ground cardamom?<p>Do you toast each spice?<p>How long do you cook your onions?<p>And so on. Eventually you get to an absolutely gigantic amount of options that all generate a somewhat similar dish, but with key sensory differences. They may all be ‘chicken tikka masala’ but I’d argue you’d have a very different eating experience across that decision spectrum.<p>I think this may also play (specifically for Indians) into the idea that moms is best. It’s probably because mom’s is universally unique and you crave that nostalgia.
Perhaps it’s just me, but I’ve cooked recipes off of 50 year old, grease stained index cards written in barely legible cursive, whose ink has all but rubbed entirely away. And it was fine. Worrying about recipe format is like trying to improve reading as a technology. The state of the art is both really simple and really old. It’s hard to mess up (format-wise, recipe content can definitely suck) and it’s hard to improve.<p>Much more important to me: is the listed cooking time of onions accurate.
A nice demonstration of how JSON is a stupid way to manage complex text documents.<p>It is not clear why that would be better than an xml-type arrangement like<p><step>cut your <ing>apple</ing> into slices<step><p>Or even just plain text.
There actually is the BatchML stardardized recipe format, even if it's a different kind of recipes I'm talking about. ISA-88 recipes for describing pharma/chemical batch production processes.<p><a href="https://github.com/MESAInternational/B2MML-BatchML">https://github.com/MESAInternational/B2MML-BatchML</a>
This hurts a little to read. Think about the use cases for recipes:<p>- Shopping<p>- Scaling up/Scaling down<p>- Finding ratios of key ingredients when you're looking at multiple recipes to figure out a dish or what's wrong with the last recipe you tried<p>- Mise en place, which is conventionally omitted except in very detailed recipes<p>- Planning cooktimes<p>- The actual cooking process<p>And as a home cook, I'm not personally experienced with commercial use cases, but there's even more there: costing servings, menu planning, mise across several dishes with common ingredients, etc. Having seen some commercial recipes, pros will frequently use very simple lists of ingredients and just a few notes on technique. Bakers will use baker's percentages.<p>The weird "cooking for people who insist on modeling the world in complicated categories" format doesn't support these very well, but it sure helps with "is grinding the whole spices a substep of combining the spice mixture?".
I've also been thinking entirely too much about a good recipe structure.<p>For now I've ended up on ingredients being more or less recipes themselves, and recipes being recursive (as in, recipes use other recipes to create new recipes). Some recipes you can either buy & make yourself. For example, sweet soy sauce: easy enough to make but you could also just buy it in the store. The resulting structure is basically:<p><pre><code> Recipe:
directions: rich text
storageInstructions: rich text
prepTime: minutes
cookTime: minutes
priceEstimateperServing: money
ingredients: RecipeIngredient[]
// other fields (e.g. tags, id, name, slug, purchaseableAt, nutrients, etc)
RecipeIngredient:
recipeId: reference to recipe
ingredientId: reference to recipe as well
// Allows grouping ingredients (e.g. "sauce", although the sauce could be a recipe of its own instead)
group: string | null
</code></pre>
There's some challenges with this though:<p>- If you have a shopping list, how do you determine in a complex recipe which "recipes" you'll purchase and which you'll make from scratch (UX issue)<p>- Some recipes may have alternatives instead (for example: if allergic to X, substitute with Y)<p>- It puts a lot of burden on the recipe writer.<p>- Some recipes don't scale linearly with just the ingredients, but perhaps also the cookware (baking a cake for example). Cooklang docs talk about this as well.<p>Scaling of recipes could be done with a measurement-aware type. Something similar to frinklang[0] for example.<p>[0]: <a href="https://frinklang.org/" rel="nofollow">https://frinklang.org/</a>
This is something I get (better ways at storing and using information.<p>I like the of a list of ingredients with the quantity in the top and then repeated in the steps (if no quantity is mentioned in the steps its implied the whole ingredient is used). This makes sense in that you may need to have on hand 3 tbs of butter but 2 get melted and mixed in step 3, and 1 is used to grease the pan in step 5.<p>The next dimension would be a language/glossary of preparation terms (slice apple - how? radially or into x thickness sheets?) This would be helpful for those without any clue on common actions and maybe later for automation. Though cooking is way more an art than just a set of steps and standard unit quantities.<p>With a glossary you could search for recipes that use grated apples or recipes that use a food processor, or don't use an oven, etc.<p>Good "food for thought" :-D
Since people are posting their respective recipe formats, I'll throw in one created by a friend from college. I haven't tried any recipes in this format, but the color coding of processing/ingredient blocks to the vertical time axis and clear listing of how ingredients get processed together are appealing.<p>I've had multiple recipes on common recipe sites in which, mid-cooking I've realized were missing steps, didn't mention reserving a portion for later, or some elements were not impacted by the serving size multiplier. A diagram of some sort could help me reduce my error rate.<p><a href="http://torfinseth.wpengine.com/wp-content/uploads/2016/07/Bulgogi.png" rel="nofollow">http://torfinseth.wpengine.com/wp-content/uploads/2016/07/Bu...</a>
Nice, I have also created a language for recipe based on cook-lang (I didn't use cook-lang because I was not convinced by the syntax). The language is called recipe-lang[0] and it powers <a href="https://www.reciperium.com" rel="nofollow">https://www.reciperium.com</a><p>Check it out, I've open sourced as well a syntax highlight for vscode, a cli for the terminal, a tutorial and a playground, and the wasm modules.<p>I use the language for more than food recipes, see:
<a href="https://www.reciperium.com/woile/garlic-tea-for-plants" rel="nofollow">https://www.reciperium.com/woile/garlic-tea-for-plants</a><p>[0]: <a href="https://github.com/reciperium/recipe-lang">https://github.com/reciperium/recipe-lang</a>
I'm entirely in the "make it easy" camp. I'd rather spend more time gathering, cooking and eating recipes than developing an over-complex schema which I have to think about all the time. I found this [0] which converts markdown and just keep my recipes in Obsidian with a simple ChronoSync to periodically upload stuff to the family recipe website. I did dabble with a scraper that turns web recipes into this same markdown format which is quite fun but really just simple as possible is the way for me!<p>[0] <a href="https://github.com/jeffThompson/Recipes">https://github.com/jeffThompson/Recipes</a>
Cooklang seems pretty much perfect for every use case I can think of.<p>I would probably prefer a more generic syntax if I were doing it from scratch, but then I'd just wind up with HTML and it wouldn't be as good for recipes.<p>I could see a more structured approach being useful if you were following one step at a time on a tablet, so maybe that scales better to more complicated recipes?<p>Most of the stuff I cook is simple enough it all fits on one screenful anyway, on the rare occasion I even use a recipe at all, so I'm not quite sure what the best approach is to cover very complex recipes.
Should include a field for how much the person documenting the recipe loves/loved the cook.<p>Then I can search by "love" field <= 0 and get the best recipes. Because let's face it-- everything with the highest love field is really being documented for the documenter. But if it's zero (or even better, negative), that's likely to be a good recipe.<p>Imagine: "I hated that guy sooo much, but damned if he didn't make the best potatoes au gratin." That's a recipe I want to try.
IMHO for mostly text data where you need a bit of custom formatting(e.g. cooking recipes) I would probably choose to go with AsciiDoc and then just adapt a rendering engine to make it look pretty. This way you get all the tooling and learnings that AsciiDoc has accumulated over the years and avoid having to spend time on a DSL and edge case detection that inventing a new standard will require.
Interesting... this kind of codifies what I usually have ChatGPT do with recipes I find. I have it standardise the measurements (I like a mix of weights in grams and volumes in Imperial; sue me), give me a list of utensils and containers, what order I need to have those implements in, and an estimate of time required in each phase of the recipe.
Google does a really good job of this.<p>Allows for videos too. Sauces and Main Dishes in the same recipe. It’s comprehensive.<p><a href="https://developers.google.com/search/docs/appearance/structured-data/recipe" rel="nofollow">https://developers.google.com/search/docs/appearance/structu...</a>
Thinking of good recipe format I think there are quite a many things that could or maybe should be included. Like ratios, maybe minimum and maximum scaling. Portition size, both as main meal or as side. And then total use of ingredient if used in multiple steps.
Here's an idea. A recipe is ultimately a checklist. It's essentially a multi-flow checklist with parts that need to be done sequentially and other parts that can be done in parallel.<p>So if we had a checklist format, we could easily derive a recipe format from that.
What about the table format used by <a href="https://www.cookingforengineers.com/" rel="nofollow">https://www.cookingforengineers.com/</a> ?<p>Though, tables in markdown are not so easy to read unless you put effort into formatting the data.
cooklang is very nice but not all parsers seem willing to display comments or metadata. Eg there are two plugins for obsidian but neither seems willing to display the recipe description or anything else that isn’t a step.<p>You might also want to consider why you want your recipes to be machine readable. I loved the idea in theory but unless you’ve integrated this with your smart larder/fridge or something it might not be useful.
I run <a href="https://www.plainoldrecipe.com" rel="nofollow">https://www.plainoldrecipe.com</a><p>Had no idea about some of these other formats!
With latest LLMs I feel there is less and less need to be structured about authoring recipes.<p>I now jot down rough notes in Obsidian when I make a meal I like, and let AI re-format it if I want to share the full recipe with somebody. This also lets me control the output: if I’m sending the recipe to somebody who is new to cooking, I might ask for a more detailed output than if they were only interested in my flavour combinations or specific techniques.
Recipes should be handled like love and fights. Feelings. Understanding of the non-understandable. Emotional to the smell. Adventures to the mouth. Travelling with it. Close your eyes and let it flow from the tongue, dream of where you are with that taste.<p>Cooking is more like life than mixing things. There is a hidden magic to it. It's the closest thing to magic next to programming.<p>Exactly like programming. It can get to you and will swallow you whole if you let it.<p>Go eat now. Eat well. Sleep well. Love well. That is the essence of a good life.