12 ms·
Cooklang – Recipe Markup Language
- rpearl 3y agoPretty much every recipe written since literally the 1890s / Fannie Farmer already has pulled out ingredients and quantities into their own separate section from steps. To use cooklang, it appears that I have to rewrite recipes to include ingredients inline. No other recipes tend to use this style, because it is harder to read. If I write recipes in cooklang, the plain text of the recipes is harder to understand without tools that speak cooklang, forcing me to use the tools to get an understandable format. The output of the CLI tool seems like a better format than the format itself!
- stevage 3y agoI don't think there's anything wrong with this approach. HTML is not super readable - that's why we use a browser to read it. Same thing here. And personally I'd prefer to see quantities next to where they're being used, rather than just "the milk" or whatver.
- slabity 3y ago> To use cooklang, it appears that I have to rewrite recipes to include ingredients inline. No other recipes tend to use this style, because it is harder to read. I don't understand. Recipes absolutely include ingredients inline, because unless your recipe is a single ingredient you would need to mention the name of the ingredients that step uses. The option to include measurements with the ingredient is also important for recipes that use the same ingredient in different steps. The fact that it generates the ingredient list from the instructions is a positive, because you only need to modify the recipe in a single location rather than multiple locations. Those old 1890s cookbooks you mention often have typos in either the ingredient list or instructions because of this. > If I write recipes in cooklang, the plain text of the recipes is harder to understand without tools that speak cooklang, forcing me to use the tools to get an understandable format. The output of the CLI tool seems like a better format than the format itself! But that's exactly the purpose of markup language. Nobody is saying XML is easier to read than a table generated from XML. Neither is HTML, LaTeX, or any others. The only exception to this rule I can think of is Markdown, which is at best equally readable in both plaintext and rendered formats. The output of the CLI tool is suppose to be a better reading format.
- tharkun__ 3y agoWhat he's saying is that it's easier to have the ingredients in a list at the bottom/top instead of strewn around the text. Yes the tools can generate the list but you need the tools. Or read the entire text to parse out the list yourself. Sure some recipes require the same ingredient in different steps. Why optimize for an edge case and making the default case harder? It's solved "take half the butter..." and "with 100g of the sugar... Pour the rest of the sugar..." works well for the 2% of recipes you need this in.
- slabity 3y ago> What he's saying is that it's easier to have the ingredients in a list at the bottom/top instead of strewn around the text. I understand that part. What I'm questioning is how does including an ingredient list also eliminate the need to include the ingredients inline? I don't even know how you'd make a recipe that doesn't say the ingredient names inline. > Yes the tools can generate the list but you need the tools. That's kind of the entire point of markup languages though. You define a clear schema that a tool can process to generate a clean or convenient document out of. This is true for pretty much any markup language. If that's an issue for some reason then you can just use plaintext. > Sure some recipes require the same ingredient in different steps. Why optimize for an edge case and making the default case harder? It's solved "take half the butter..." and "with 100g of the sugar... Pour the rest of the sugar..." works well for the 2% of recipes you need this in. Begging the question of whether this is actually an edge case. I'd argue it's not. This case covers a huge number of the recipes I use, including simple ones like bread recipes. I'd also argue that this makes the "default case" easier, as you only need to focus on writing the actual steps involved. You're not going to get any typos or mismatches between your ingredient list and the instructions. That's especially a benefit if you're editing those recipes down the line, which is what I presume the typos in my older cookbooks have. An argument could be made that it makes reading the markup annoying, but I need to reiterate that markup is primarily for writing.
- nitrofire69 3y agoI didn't see if there was a way to customize ingredients lists, but it a lot of recipes I make and use the ingredients list will be more descriptive of the specific type of ingredient, and in the actual recipe it will just use a general term so it's easier to read, for example the ingredients would read: * 2¼ cups all-purpose flour, sifted * 4 medium ripe bananas, mashed ... and then in the actual recipe it would just say "in a large bowl whisk together the flour, sugar..." and "in a medium bowl, combine bananas, butter, eggs..." It seems in this lang it seems like it would need to read: "in a large bowl whisk together the all-purpose flour (sifted), sugar..." and "in a medium bowl, combine medium ripe bananas (mashed), butter, eggs..." It just makes the actual recipe part messier than it needs to be. But like I said, I only skimmed the spec, maybe there is a way to customize and be more descriptive in the ingredients list.
- sramam 3y ago> To use cooklang, it appears that I have to rewrite recipes to include ingredients inline. No other recipes tend to use this style, because it is harder to read. This was my initial thought too - ChatGtp to the rescue: https://sharegpt.com/c/ivxamU9 https://sharegpt.com/c/ivxamU9 I think this would be really cool to store the recipes one has tried and likes locally. As much as I like the convenience, it's a double edged sword - we are removing the incentive of recipe authors to share. The recipe credit: https://www.isabeleats.com/mexican-slow-cooker-pork-carnitas-tacos/ https://www.isabeleats.com/mexican-slow-cooker-pork-carnitas...
- sseagull 3y agoI've always liked the presentation of Cooking For Engineers. Plenty of instruction, but the table at the end that visually combines the ingredients and techniques is a nice idea for quickly glancing at while cooking. See for example https://www.cookingforengineers.com/recipe/36/Meat-Lasagna https://www.cookingforengineers.com/recipe/36/Meat-Lasagna
- JackMorgan 3y agoThat's how I originally learned how to cook! I worked through many of those recipes until I was comfortable enough that now I mostly wing it. Wow it's been years since I opened this site up, what a callback!
- 22c 3y agoThis is interesting though perhaps a bit over-engineered. I'd probably find myself less motivated to simply type something out to recipe.txt vs. manage all this but CookCLI does open up some interesting possibilities. The first thing that came to mind would be that it'd be cool if CookCLI could "halve" recipes automatically. Say you had a recipe for 12 muffins but you only wanted to make 6 or 4, it could automatically divide those quantities and spit out a new recipe or shopping list. Another cool CLI feature would be unit conversion; converting things like fluid ounces, or cups into ml. My other piece of feedback is the overloading of {} for ending multi-word ingredient seems a bit off. It's more syntax but I'd still rather have something dedicated for that purpose eg. @(ground black pepper)
- stevage 3y ago>My other piece of feedback is the overloading of {} for ending multi-word ingredient seems a bit off. It's more syntax but I'd still rather have something dedicated for that purpose eg. @(ground black pepper) Yep, or just use the same tag marker at the end of the multi-word thing: #pot, #pressure cooker#, @onions, @ground black pepper@.
- martininmelb 3y agoI was just about to write a comment saying that it would be more consistent with the other markup to have: @{ground black pepper}.
- light_hue_1 3y ago> The first thing that came to mind would be that it'd be cool if CookCLI could "halve" recipes automatically. Say you had a recipe for 12 muffins but you only wanted to make 6 or 4, it could automatically divide those quantities and spit out a new recipe or shopping list. The problem is that scaling recipes doesn't work this way, particularly for baking. Some ingredients don't scale linearly, cooking and mixing time doesn't scale linearly, etc. Savory items also have scaling issues, for example, some dishes include extra liquid that is lost to evaporation while cooking; you would likely not want to scale that up and would end up too much liquid at the end if you did. The opposite can be a problem too, don't scale down liquids in pressure cookers without thinking because you might end up without enough. You would need a lot of extra metadata to be able to effectively scale recipes.
- duped 3y ago> Slowly add @milk{4%cup} [- TODO change units to litres -], keep mixing No! Handle units! @milk{4%cup} should be trivially convertible to liters and configured by the user. For harder conversions (volume to mass) keeping a list of ingredients and their densities (configurable of course) would be extremely useful. On that subject, being able to specify a recipe in terms of ratios and then automatically convert it to scale would be a super power that I can't beat by hand. For example when I bake I do everything by weight and have all the recipes I like written out by hand with unit conversions. Because measuring by volume isn't easier in 2023 than placing your mixing bowl on a kitchen scale and balancing everything to the mass of your butter and eggs.
- lolinder 3y ago> Because measuring by volume isn't easier in 2023 than placing your mixing bowl on a kitchen scale and balancing everything to the mass of your butter and eggs. Eh, I've tried both and I have to disagree. Pouring milk or oil may be easier with the scale because you have very precise control over the flow rate, but for flour and other dry goods it's far easier to scoop, scrape, and dump a cup than it is to add a bit at a time while avoiding the sudden avalanches that inevitably start as things loosen up.
- duped 3y agoI just pour it right out of the container I store it in and don't have trouble with clumping. Life is easier and cleaner without packing flour.
- yodon 3y ago> Weight vs volume measurements This is as un-winnable a debate as vi vs emacs. The world is full of both kinds of people. Any attempt on the part of the format to dictate one or the other approach will simply reduce the use of the format. As firmly convinced as you are of the rightness of your position, there is at least an equal number of equally committed champions of the other position, regardless of which position you hold. Encouraging/facilitating the presentation software to accept data in either format and render it in either format will be the winning solution.
- stevage 3y agoSome of the syntax seems...suboptimal. For instance, why is the % required? There aren't that many units; surely {0.5 kg} can automatically be parsed, rather than requiring {0.5%kg}.
- freddie_mercury 3y agoSurely there are thousands and thousands of units? Or do you think the software should only support English? A Vietnamese recipe will often use "gr" for grams (even though SI says that's not correct but what are you going to do?). A Japanese recipe will say something like "1/2パック". And so on. Any time a recipe says something like "a dash", "a pinch", "a handful", "half can", "a dollop", "a generous pour", "to taste", or "extra large eggs" -- all things that are extremely in real world recipes -- it will be written in the local language. I don't think the markup language intends every single measurement to be converted into laboratory measures using only official abbreviations, which feels unnecessarily restrictive.
- fn-mote 3y agoJumping ahead, I want a plugin that automatically applies "standard" volume to mass conversions for me. E.g. 1 C whole wheat flour is 5.5 oz (or 150 g). This is walking the line of laziness (why don't I just look them up myself), but it sounds great. Maybe I can combine the web server with a customized GNU units. I don't love the % either. Fun stuff, nice creation!
- ezfe 3y agoBut 1 C of flour is 120 g
- guhidalg 3y agoYou can assume ingredients are mostly water and use 1kg = 1L for conversions, but a lot of ingredients violate this density assumption. You don't have to do the hard work to figure out the densities, the USDA already did it in the FoodCentral database. If you want a service that allows you create define recipes with both mass and volume indications, check out CookTime! Here's a rather complex macaron recipe from one of my friends: https://letscooktime.com/Recipes/Details?id=8a67c391-ddcc-4d0b-b2ae-bbbdb1da2dbc https://letscooktime.com/Recipes/Details?id=8a67c391-ddcc-4d...
- mcdonje 3y agoPutting ingredients inline is interesting. I think I actually see the sense in it. As a reader, I want the ingredients list at the top, but as a writer, I'll think about ingredients as I write the instructions. So, doing it this way potentially saves on jumping back and forth between the instructions and the list, which almost feels like boilerplate. However, if you want to make shopping list annotations, then you're doing that extra work anyway. In a separate file? It'd be cool if the spec allowed for doing an ingredients list with annotations at the top of the recipe if the writer so chooses. The current syntax works, but not for all people/scenarios. How would I do recipes with sections? For instance: https://www.kingarthurbaking.com/recipes/fast-summer-berry-pie-recipe https://www.kingarthurbaking.com/recipes/fast-summer-berry-p... Note the ingredient sections; crust, filling, topping. Note the step numbers. Note the link to another recipe. Note the step section titles that are represented here in bold and which don't perfectly match with the ingredient sections. Note the footnotes at the end. Not sure how I'd do most of those things with this markdown spec.
- deleted 3y ago[deleted]
- Kalabasa 3y agoI like how it escalates as I scroll further. It has a website, cool. Then it has an app?! Then finally you reach the footer and click on https://github.com/cooklang https://github.com/cooklang, then you see it has a bunch of cooklang libraries, e.g., TypeScript, python, C, etc.! It even has a VSCode syntax highlighting package! I appreciate the comprehensiveness of the project. It’s more than a markup language, cooklang seems to be an entire ecosystem.
- armanboyaci 3y agoReminded me this blog post about the complexity cost of trying to cover all the edge cases, using the example of recipe writing! https://buttondown.email/hillelwayne/archive/edge-case-poisoning/ https://buttondown.email/hillelwayne/archive/edge-case-poiso...
- giraffe_lady 3y agoMy career was cooking for a long time before I ended up coding for a living and that's the only post I can think of by a programmer who really gets it. It's pretty funny watching every conversation about food or cooking on HN turn into confident assertions of how it should be done. Meanwhile every attempt to do it smashes right into these problems and, while maybe gratifying for engineers, are virtually worthless to cooks. You can tell by the fact that no cooks use these systems.
- scrps 3y agoA feature I think would be helpful would be a reverse shopping list (for lack of a better term) where you can say 'I have ingredients a, b, c... list what recipes do I have all or ≥ n% the ingredients for?' I shall poke around the cli code.
- thebricklayr 3y agoI just added multi-ingredient keyword search across all of your recipes to Umami (https://www.umami.recipes https://www.umami.recipes). If you’re on iOS, I’d recommend checking it out!
- scary-size 3y agoLooks promising! I’ll give it a thorough test. Been working on my own recipe clean up tool [1]. Does your app all the scraping and parsing on the client side? [1] https://pretty-recip.es/ https://pretty-recip.es/
- thebricklayr 3y agoWow, this is awesome! Your layout, subtle dividers, and serifed font really come together perfectly. At the moment, Umami's scraping is done server-side. I'd really like to speed it up, so I'm going to start working on a 100% client scraper soon (for the native apps & browser extensions; the web version will always have cross-domain browser restrictions though).
- samldev 3y agoUmami looks great, I just sent it to my wife who just uses Apple notes for recipes right now. I’m curious, how can you offer it for free while having server side processing / syncing etc?
- thebricklayr 3y agoIt's few enough users right now that I can cover the couple bucks per month in server costs. If more people start to use it, I'll make it paid (either upfront or subscription, not sure yet), but I'll grandfather all existing users as free.
- lucasban 3y agoIt would be cool if someone could make a web recipe parser (similar to how Paprika works) that could export in this format, or at least convert another recipe file format to this one.
- Niksko 3y agoI would use this if: * it supported units and conversions * I'm now one of those annoying obsidian people, so it needs an obsidian plugin. EDIT: It has an obsidian plugin, though the last release was 2 years ago: https://github.com/deathau/cooklang-obsidian https://github.com/deathau/cooklang-obsidian
- deleted 3y ago[deleted]
- soperj 3y agoI actually made a webapp[0] that does a lot of this, but the it's markdown instead of it's own markup language. Benefit of it being online instead of having to run a local server is that you can use other people's recipes (or fork them if you want to alter them). There's also a drag and drop interface for weekly meal planning that makes your grocery list for you instead of having to write them out. [0] - www.reciped.io
- tasuki 3y agoI like the look but it's extremely unpolished (yet). Work in progress? The search is spartan at best and I could not find a list of all the recipes. Hamburger menu leads to a links page which is empty. I quickly gave up.
- soperj 3y agoEmpty? I can't duplicate that for the life of me. There should be a register and login link, or more if you're logged in. A list of recipes would be completely overwhelming way to browse if you're actually looking for something, you can search by any ingredient and get a list of recipes. It's definitely something I'm still working on, but has been very usable.
- tasuki 3y ago> Empty? I can't duplicate that for the life of me. My bad. Yes there's the register and login links. I guess I was taken off guard by the hamburger menu redirecting to https://www.reciped.io/links/ https://www.reciped.io/links/ and showing the links there. > A list of recipes would be completely overwhelming Well it would be a good way to see how many recipes there are. https://www.reciped.io/search/?search=flour https://www.reciped.io/search/?search=flour currently lists 4 recipes and 2 ingredients. That, is not very many recipes requiring flour? https://www.reciped.io/search/?search=egg https://www.reciped.io/search/?search=egg lists 3 recipes. https://www.reciped.io/search/?search=salt https://www.reciped.io/search/?search=salt shows 12 recipes, leading me to think you have... hmm... maybe about 20 recipes total? Not my idea of overwhelming. --- I mean, I could register, sure. But it's not even clear to me why I'd want to: - If I want to find interesting new recipes, I don't have to register. - If I want to keep track of my recipes, so that I can make it them the same way the next time, I don't want to register and record my recipes on your website, because now anyone can alter them. --- I like the website overall! It's minimalistic, no bloat. And I like how you include the nutrition information!
- NoMoreNicksLeft 3y agoThis seems primitive. I see there is some understanding that there needs to be "cookware" elements, but how am I supposed to indicate it requires a brick pizza oven or a tandori oven? These aren't trivial cookware. I'd want some way to filter these out without having to go through and indicate the 500 large appliances I don't have before I can see which recipes are feasible. I could add metadata tags that would indicate just what the dish was (entree, or a fancy breakfast/brunch, or a desert, etc), but since there's nothing like a standard tag if anyone else gets the file those tags are mostly worthless (their software won't be able to sort a bunch of recipes into the correct categories). There's no way to indicate how many times the recipe has been verified (apparently the vast majority of online recipes are made-up bullshit that even the author hasn't bothered to cook even once). Even pictures... I might want more than one non-step picture for the recipe. Naming convention is whacked out. This works for 5 recipe files in a folder. What happens when I have 80,000? Or 2.1 million? r/datahoarder would be disappointed. How many different pot roast recipes is that? Is it only eight dozen, or is it more like 900? Are they all just numbered, 1 through n? Hell, there are some classic recipes that are seasonal. They want not just "chicken eggs" but "spring chicken eggs" as opposed to summer or fall. How do I filter those out so I don't see them in November?
- dang 3y agoRelated: Show HN: CookLang – Recipe Markup Language - https://news.ycombinator.com/item?id=28997309 https://news.ycombinator.com/item?id=28997309 - Oct 2021 (146 comments)
- macocha 3y agoOn topic of different representations of cooking recipes I really dig a way the recipe cards are done here: https://www.cookingforengineers.com https://www.cookingforengineers.com. There's something quite simple and elegant about them.
- jkellermann 3y agoSounds interesting! Some years ago, I came across a recepie as flowchart graph. This idea appealed to me instantaneously, because a picture to me is a thousand times better than a lettersoup. Especially when I'm not constantly reading the text, but have to check the pots and pans regularly. I think this markup language could be used as input for an engine that generates nice recepie graphs. And then an integration into the tandori.dev application?
- brisketbbq 3y agoJust about three weeks ago, I made a fossil repo to keep track of my recipies. I write them in markdown and use fossil's webserver to be able to access them while in the kitchen. If I need to see ingridents while i'm out, i activate my tailscale VPN on my phone and browse to the fossil webserver. Thankfully i'm not the only one who has oven-engineered a simple solution.
- brisketbbq 3y agoIs there a way to see recipes based on the cooking method? Show me all the recipes that use the oven, sous vide, grill, smoker, etc.
- yonrg 3y agoI started to note down recipes as sequence diagrams. This gives me clear insight about duration (incl preparation and waiting times, etc), order of steps and parallelization of steps. I wrote them with pen and paper. Recently I experimented with the mermaid extension for markdown. It has its drawbacks but works.