10 ms·
Thinking about recipe formats more than anyone should
- Finnucane 2y agoA nice demonstration of how JSON is a stupid way to manage complex text documents. It is not clear why that would be better than an xml-type arrangement like <step>cut your <ing>apple</ing> into slices<step> Or even just plain text.
- pwg 2y agoSmells somewhat like the old adage of: "if the only tool you have is a hammer, all your problems start to look like nails".
- j_crick 2y agoI was reading through this and caught myself thinking "man, if you want people to read your recipe then just write it", and for that plain text or some minimal markup still works wonders...
- chefandy 2y agoThat's great for writing recipes for someone to read as recipes, but it's not very useful if you're trying to create a collection of structured data from recipes.
- code_biologist 2y agoThis is one of the golden applications of LLMs. You can see the variety of structured formats proposed in comments, the different use cases, and honestly it seems like a bad idea to privilege any single format. Instead, you as a data consumer can use LLMs to parse common language recipes into the structured format most appropriate to your needs. DAG or linear? JSON or XML? You decide!
- chefandy 2y agoIf your primary use case is displaying individual recipes that makes good sense. Less-so if you need reliable calculations at a larger scale. For example, if I was making planning software for a catering company, they’d want to know how many cases of onions they need this week for the 9 events with different menus. I don’t trust LLMs for that level of accounting yet. Hopefully soon!
- Finnucane 2y agoThe reason plain-text markup exists is so that someone can write it, then have it be machine-translated into some more structured format.
- chefandy 2y agoAs someone that's written a whole lot of code parsing both complex XML and JSON, I'd go with a more restrictive JSON format over a more idiomatically correct and elegant (from the data perspective) XML format any day. Complex XML sucks for storing structured data unless it's as restrictive as a JSON document, and then... The simple use case for XML is always easy, but then it always ends up looking like this: <step>prepare fruit <step>prepare <ing variety"bartlet anjou comice">pear slices</ing> from a <ing state="unprepped">pear</ing> <step>wash</step> <step>trim <step>remove stem</step> <step>peel</step> </step> <step> <step thickness=".25mm">slice</step> </step> </step> <step>... Plain text is great and all as a display format but it sucks even more than XML to parse as a data format. You can make JSON that's just as stupid as XML but especially if you have people hand-writing XML, it invites a lot of complexity for a little more expressiveness. If you need to, you can always have flatter XML markup in JSON fields to avoid the large scale recursive structural insanity when parsing.
- Terr_ 2y agoMy gut feeling is that there's something going on here with dueling priorities between (A) the best editing experience with a plain text editor vs. (B) the clearest storage format. This leads to things like "too much inlining" or "too much duplication". In contrast, imagine relaxing the everything-in-notepad requirement, imagine a renderer that can easily display cross-referenced materials in a readable way. Or a step beyond that, an editor which also gives you "jump to definition" etc. That change permits a much more internally-consistent XML file, such as one where "materials" and "steps" are separate sections, and any step can references a material that is being used as input or output, with something like <mat_ref id="sliced_uncooked_apples"/> .
- chefandy 2y agoI see the value in using xml for simple markup and standardized entities/references but the flexibility makes navigating whole documents more cumbersome. I think that using it inline is a good idea, but above the paragraph level I don’t see the benefit of using it at all. Even in the supremely consistent world of open doc xml, parsing is a bear of a task. For something like this requiring a fraction the complexity, it should either force more internal structure— XML markup in json fields representing ingredients lists, etc— or just decide it’s for presentation only and go with HTML or rtf. I probably also have a different perspective on both of these topics than most. I’ve dove a lot of automated document work, and also was a chef so I’ve got a more structured, less prosaic approach to recipes.
- deleted 2y ago[deleted]
- JoshMandel 2y agoI 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? A recent example: I really like the Hainanese chicken recipe at 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 https://www.google.com/amp/s/amp.theguardian.com/food/articl... ... But I find it very hard to follow in this format. Using o1-preview to restructure it, I get something that I find much easier to follow during my cooking workflow: https://chatgpt.com/share/6733e594-df28-8009-ac80-d5dabd1ae01b https://chatgpt.com/share/6733e594-df28-8009-ac80-d5dabd1ae0... But getting from a well-written recipe to structured data is now pretty straightforward... if/when you need structure data.
- exmadscientist 2y agoPresentation and structuring is really, really important. The best I've found so far is a multicolumn format: https://i.imgur.com/w0UrJt5.png https://i.imgur.com/w0UrJt5.png Column 1 is the quantity. This doesn't really belong in the first column but it matches traditional ways of writing things and doesn't cause any actual trouble to do it that way, so whatever, we can do it that way. Column 2 is the ingredient. And column 3 is the cooking instructions. The rows are then grouped (shaded) by which ingredients go into which cooking instructions. You can scan down columns 1 and 2 to get a prep / mise en place list, or just column 2 to get a shopping list (possibly involving deduplication if an ingredient is called for more than once), then execution is just running down column 3. The only real problem with execution is when it gets nonlinear (you want to overlap steps 3 and 4 in that recipe, for example) but that's a problem with any format I know of. It's not perfect, but it works really, really well, and better than any other format I've ever seen. ...also now I want chili since it's cold and wet here in Seattle. And I should probably revise that recipe to reflect what I really do, but it's just chili, it's pretty tolerant of whatever you have lying around....
- guhidalg 2y ago
- jsmith99 2y agocooklang 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. 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.
- numlocked 2y agoMany 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. For an example, here's a gantt chart for Beef Bourguignon: https://ibb.co/c3TVTnX https://ibb.co/c3TVTnX Note that when I print it on a (physical) recipe card, I have the 'prose' instructions underneath. I still think this is a pretty good idea, and I still use the cards for this recipe, and Beef Wellington.
- ahnick 2y agoReminds me of the cookingforengineers.com format to some degree. Here's an example. You'll need to scroll down to see the actual recipe format. https://www.cookingforengineers.com/recipe/194/Cream-of-Mushroom-Soup https://www.cookingforengineers.com/recipe/194/Cream-of-Mush...
- numlocked 2y agoHmm interesting. But I have to confess I have no idea, intuitively, how to read that format. I’m sure it works once you understand it, but if you need an instruction manual for the format then maybe you’ve lost the plot a bit.
- ahnick 2y agoIt reads left to right, top to bottom. Ingredients are on the left and then each step boxes around the items involved in that step. Using the mushroom soup recipe as an example: (1) Melt the butter. (2) Wash and dice the onions, celery, and leeks. (3) Sweat the melted butter from step (1) and the diced onions, celery, and leeks from step (2) together for 6 minutes.
- numlocked 2y agoAfter reading another comment here about a recipe being an “upside down tree” I now understand what at least this format is trying to accomplish. It has some really nice properties, but trades off a key feature of the gantt format: your hands can only be doing one thing at a time. With the gantt format it’s very clear what you are supposed to be doing at any time and it preserves the order of operations. It doesn’t express how things are combined, however, which the tree format accomplishes. My motivation for the gantt format was to prevent getting “meanwhiled” by a recipe. You are chugging along, and think you are in good shape, and come across that dastardly word in a recipe: Meanwhile. Turns out you should have beaten the eggs to a stiff whip 15 minutes ago.
- fouc 2y agoHere'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. So if we had a checklist format, we could easily derive a recipe format from that.
- mattdesl 2y agoWith latest LLMs I feel there is less and less need to be structured about authoring recipes. 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.
- Mathnerd314 2y agoYeah, personally I'd use markdown too, at this point it is easier to use llama-3.1-8b to parse markdown / text into your JSON format of choice than it is to massage recipes into a specific markup like Cooklang.
- Terr_ 2y ago> With latest LLMs I feel there is less and less need to be structured about authoring recipes. Assuming the LLM doesn't unpredictably add something poisonous. :p https://news.ycombinator.com/item?id=42123455 https://news.ycombinator.com/item?id=42123455
- deleted 2y ago[deleted]
- chuckl 2y agoJust finished my own overthinking of recipe structures. I figure that a recipe is more or less an upside-down tree! Where you start with a list of all the nodes (ingredients) Have a n:1 relationship with the next series of nodes (steps) until you finish at a single node (the dish you're trying to make) 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. An example being https://cookbook.cstebbins.com/recipe/bul-koki https://cookbook.cstebbins.com/recipe/bul-koki With the underlying tree structure looking like https://assets.cstebbins.com/cookbook/images/bulkokiTree.png https://assets.cstebbins.com/cookbook/images/bulkokiTree.png
- deleted 2y ago[deleted]
- pickledish 2y agoHa, your example makes intuitive sense right when you see it. Really clever thanks for sharing it!
- chuckl 2y agothanks for checking it out!
- 4b11b4 2y agoofc, trees
- nicbou 2y agoWhat if the same ingredient is used twice in a recipe, for example for cooking and finishing?
- chuckl 2y agoI think of them as 2 different nodes, 2 instances of the same type of ingredient. Practically I just have it listed twice if it's important like butter. https://cookbook.cstebbins.com/recipe/the-best-swedish-meatballs https://cookbook.cstebbins.com/recipe/the-best-swedish-meatb... otherwise if it's a staple like salt I just say something like "stir in and season with additional salt and pepper to taste" like in https://cookbook.cstebbins.com/recipe/sloppy-sophisto-joes https://cookbook.cstebbins.com/recipe/sloppy-sophisto-joes
- ahnick 2y agoIMHO 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.
- guhidalg 2y agoAlso the people writing recipes (my parents for example) are _most definitely_ not going to learn a DSL, they just want a text box where they can type whatever they want. If you care about having structured data, other humans with more structured proclivities need to do that for you.
- tunesmith 2y agoRecipes are DAGs, not trees or lists.
- recursivecaveat 2y agoWorse actually: for example, many recipes for fondant call for fondant as a starting ingredient.
- 1propionyl 2y agoThe 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). 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. None of these proposals pass the smell test as being able to capture anything beyond the most basic of recipes.
- guhidalg 2y agoI'd love your opinion on my cooking site https://letscooktime.com/ https://letscooktime.com/ Though I'm a software engineer, my main user is my mother-in-law who was a nurse all her life and now likes to bake. Check out for example, this multi-component recipe for Brazilian empadas: https://letscooktime.com/Recipes/Details?id=bc786a2f-50ec-4f37-bce6-8a353651412c https://letscooktime.com/Recipes/Details?id=bc786a2f-50ec-4f...
- Lutger 2y agoNo way. The professionals I've seen use way, way simpler formats, often just simple lists of ingredients with very minimal instructions. If anything, these formats capture way too much information. For example, you can't really measure cooking times reliably unless you do sous-vide, if you want to be precise, measure temperature.
- 1propionyl 2y agoI actually agree with this. There's a ton that's between the lines in professional recipes and often much that you can't really put on paper you just have to learn at the foot of the master or try enough times you rediscover the same insights. My critique should be amended to emphasize that it's about naively constructing a model that picks and chooses elements to include based on availability, convenience, etc rather than one built by studying actual chefs and cooks and learning how they think about recipes. I can say for myself at least that for many classes of dish I barely pay any attention to the specific details in the recipe. I've made thousands of braises, I just need to know the key elements and the rest just sort of fills in (perhaps there's a comparison to musical proficiency here). I'm less concerned with "brown the meat for X minutes on each side" than "brown to mahogany". I don't find it useful when a recipe says how long to reduce a sauce, but when it says what kind of reduction in volume I should be looking for, that can be helpful. In practice I just have an image of the final product and can taste to tell if I've cooked out the acidity and water sufficiently for how I want the dish to taste. To put a finer point on it, knowing which elements of a recipe are standard procedure and which are distinct and important to the character of the dish is an acquired skill and not something any system that describes recipes as strict assembly instructions can quantify or even qualify.
- LarryMade2 2y agoThis is something I get (better ways at storing and using information. 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. 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. 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. Good "food for thought" :-D
- adt2bt 2y agoI’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. For example, think of all the decisions required to specify a curry dish: How do you cut/mash your garlic and ginger and onions? (If you even add all of those ingredients) Do you use whole or ground spices? What about for each spice? Cardamom pods or ground cardamom? Do you toast each spice? How long do you cook your onions? 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. 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.
- NoMoreNicksLeft 2y agoI'm not confident in any recipe format that I've seen discussed in this thread. Do any of the recipes you've seen online or elsewhere every bother to talk about what sort of kitchen is needed? Granted, 99% of the time it's just the standard western kitchen (stove/oven/fridge/mixer), but some recipes require less common appliances. A brick pizza oven, or maybe a sous vide machine. The data might benefit from being in a different format than the file format itself... even that might need to be different than the presentation software. Do I want to be chained to the software, or does this need to be some open format like epub? How would I search through 500 recipes, or 500,000? Do I want to search through that many, do I want to keep that many or purge the not-so-great ones? Earlier in the thread, someone was complaining that they don't want the ingredient list and numbered list instructions at the top... so is this something like html plus optional stylesheets? God help me, xml and xslt? Why are they giving me fixed ingredient quantities, rather than ratios and quantity-to-serving numbers? Do recipes need to link up? If I'm making thousand island dressing or tartar sauce, should I be able to tap a hyperlink to a sweet pickle recipe? How would that even work if I had multiple sweet pickle recipes?
- MartijnBraam 2y agoI'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. The format is pretty well demonstrated at https://git.sr.ht/~martijnbraam/fathub-data/tree/master/item/en/recipes/indonesian/main/mie-goreng.toml https://git.sr.ht/~martijnbraam/fathub-data/tree/master/item... which renders to https://fathub.org/en/recipe/indonesian/main/mie-goreng.html https://fathub.org/en/recipe/indonesian/main/mie-goreng.html 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.
- irrational 2y agoWhat about the table format used by https://www.cookingforengineers.com/ https://www.cookingforengineers.com/ ? Though, tables in markdown are not so easy to read unless you put effort into formatting the data.
- kiru_io 2y agoI was looking into the table format for my app[0], but then the notes at the end made me reconsider: Tabular Recipe Notation Patent Pending (Michael Chu) [0] https://news.ycombinator.com/item?id=42036041 https://news.ycombinator.com/item?id=42036041
- telebell 2y agoHere'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. https://imgur.com/a/RDO6j6H https://imgur.com/a/RDO6j6H
- kiru_io 2y agoThis looks very close to the table-format from Cooking For Engineers®: https://www.cookingforengineers.com/recipe/320/Sauteed-Spinach https://www.cookingforengineers.com/recipe/320/Sauteed-Spina...
- stevage 2y agoRecipes are a pretty interesting case because they're right on the edge between text with a bit of markup, and data with a lot of text.
- DavidPeiffer 2y agoSince 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. 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. http://torfinseth.wpengine.com/wp-content/uploads/2016/07/Bulgogi.png http://torfinseth.wpengine.com/wp-content/uploads/2016/07/Bu...
- eulgro 2y agoThis is how I do it. I can't stand needing to find information in ten paragraphs of text while cooking. - Ingredients are listed in one column on the left in order of use. - Duplicate ingredients are separate. - Each step has one or more input products and one or more output products, indicated by arrows, and braces to group multiple. - Handwritten because it's much easier. Computers are just too much trouble.
- Terr_ 2y agoOnly a short step now until BPEL: Bakery Process Execution Language.
- dmje 2y agoI'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! [0] https://github.com/jeffThompson/Recipes https://github.com/jeffThompson/Recipes
- Ekaros 2y agoThinking 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.
- njtransit 2y agoPerhaps 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. Much more important to me: is the listed cooking time of onions accurate.
- deltarholamda 2y agoI get the desire to computerize it. Think of all the automation that can be done! Automatic shopping lists! Unit conversions! Scale up or down! Not to mention having a good think about how to organize things appeals to the data-driven mind. But I find cooking to be resistant to this sort of thing, at least if you have a family. Meal planning is more of a negotiation than a tallying of numbers. You tend to cluster around a few, well-honed recipes that are repeated often. And when you're cooking, having a piece of paper or an index card attached to the vent hood or whatever with a magnet is far more user friendly than having to wake up a tablet or a phone. (Not to mention passing recipes down through the generations. It's not the same to bequeath the recipes to your grandchildren by saying "give me a ssh key and I'll rsync these MySQL tables to your VPS".)
- memset 2y agoI run https://www.plainoldrecipe.com https://www.plainoldrecipe.com Had no idea about some of these other formats!
- woile 2y agoNice, 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 https://www.reciperium.com https://www.reciperium.com 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. I use the language for more than food recipes, see: https://www.reciperium.com/woile/garlic-tea-for-plants https://www.reciperium.com/woile/garlic-tea-for-plants [0]: https://github.com/reciperium/recipe-lang https://github.com/reciperium/recipe-lang
- jdgoesmarching 2y agoWhat do you not like about cooklang? I’m in the early stages of building an app around it.
- woile 2y agoThe way ingredients and other things are described. I felt that explaining that a single word ingredient, requires @ only, but if you use multiple words, you have to use @ingredient with space{}, with the empty `{}` at the end can be too complicated to explain. I felt that for someone who is not familiar with these things, it can be confusing. In recipe-lang the explanation is IMO simpler: wrap the ingredient with `{}`, there are no ambiguities. {salt} or {ingredient with space}, it's quite clear where the ingredient starts and end. Once they learn that, everything else is a prefix of the curly braces, timer? t{}, link to another recipe? @{}, material? &{}. I'm considering for images something like i{} but I haven't had time to experiment with it.
- jdgoesmarching 2y agoInteresting, I’m nowhere near a place where I’m thinking about the implementation yet so maybe I’ll poke your version a bit!
- woile 2y agoawesome! let me know if you build something, I'd love to see more tooling around recipe-lang
- 23july2024 2y agoThere 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. https://github.com/MESAInternational/B2MML-BatchML https://github.com/MESAInternational/B2MML-BatchML
- aceix 2y agointeresting one. cooking for engineers :)
- ThrowawayTestr 2y agohttps://www.cookingforengineers.com/ https://www.cookingforengineers.com/
- bastloing 2y agoAnother technique would be from the Microsoft engineers that made the book series Modernist Cuisine.
- recipe_man_ 2y ago[dead]
- dbg31415 2y agoGoogle does a really good job of this. Allows for videos too. Sauces and Main Dishes in the same recipe. It’s comprehensive. https://developers.google.com/search/docs/appearance/structured-data/recipe https://developers.google.com/search/docs/appearance/structu...
- buescher 2y agoThis hurts a little to read. Think about the use cases for recipes: - Shopping - Scaling up/Scaling down - 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 - Mise en place, which is conventionally omitted except in very detailed recipes - Planning cooktimes - The actual cooking process 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. 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?".
- winkywooster 2y agoanother to add to the list is high-altitude modifications. using mark bittman’s guidelines ingredients and temperatures become a function of altitude. recently i’ve been using llms to make the modifications for me.
- buescher 2y agoOr adapting to specific dietary requirements. Simple formats and clear written language go a long way for human use cases.
- somethingsome 2y agoIt seems written by someone that does not cook, it is missing a lot of informations! In particular, the cooking time is completely useless without the heat power and the kind of pan, and conversions between pans
- alganet 2y agosemweb tech is extensible, you could write a specialized schema or ontology to express more detailed information if you want to. Think search engines for example. This "cooking time" is often displayed as metadata when you search for recipes. You're just annotating a field for the search engine to display in the results. Schema.org exists for that. Indexing larger granules of metadata. It is built on RDF so if you need something more specialized, you can use the standards to extend it. This is actually a fun ontology to think about. You'll need to model pans, ovens and all sorts of cooking hardware. I don't see that knowledge often displayed in recipe websites, so microdata probably isn't the best for a specialized system like that. It would probably use the extended schema/ontology just internally, then publish simplified cooking times for indexing.
- _randyr 2y agoI've also been thinking entirely too much about a good recipe structure. 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: 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 There's some challenges with this though: - 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) - Some recipes may have alternatives instead (for example: if allergic to X, substitute with Y) - It puts a lot of burden on the recipe writer. - 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. Scaling of recipes could be done with a measurement-aware type. Something similar to frinklang[0] for example. [0]: https://frinklang.org/ https://frinklang.org/
- danielovichdk 2y agoRecipes 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. 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. Exactly like programming. It can get to you and will swallow you whole if you let it. Go eat now. Eat well. Sleep well. Love well. That is the essence of a good life.
- lbeckman314 2y agoTangentially related: https://esolangs.org/wiki/Chef https://esolangs.org/wiki/Chef
- jancsika 2y agoShould include a field for how much the person documenting the recipe loves/loved the cook. 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. 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.
- paulmooreparks 2y agoInteresting... 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.
- eternityforest 2y agoCooklang seems pretty much perfect for every use case I can think of. 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. 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? 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.