Live data from Hacker News

Cooklang – Recipe Markup Language

cooklang.org

101–110 of 112 posts

Re: Cooklang – Recipe Markup Language

#101

Earlier quoted context omitted.

Wow, 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).

Interesting, does the server fetch the html itself? Or does the client POST it? The letter would be useful for paywalled sites like Cook‘s Illustrated. I spent quite some time on ingredient labelling (what’s a unit, quantity etc.). Feel free to ping at hn[at]franz.hamburg

> does the server fetch the html itself?

Yep, the client just sends the recipe URL and then the server fetches the HTML. Agreed, it would be better to have the client send the HTML for paywalled sites, which is another reason I just want to do it all on the client.

> I spent quite some time on ingredient labelling (what’s a unit, quantity etc.)

I can relate to you there. It was a long process of trial and error for me to get right, and there are still plenty of edge cases left to handle. Long-term I think AI + NLP will make this kind of thing easier, but for me it wasn't fast, reliable, cheap, or portable enough to run in an iOS app in real time quite yet.

Re: Cooklang – Recipe Markup Language

#102

Earlier quoted context omitted.

I'm not aware of a specific service to do what you're describing. The closest I can think of is IBM's Watson demo for recipe creation[1]. Can you tell me more about what you're looking for? CookTime's recipe object modeling is very flexible, maybe I can make what you're looking for in a generic way. [1] - https://researcher.watson.ibm.com/researcher/view_group.php?...

I will check out Watson. I'm really just looking to tag ingredients. I could always create my own tag standards for the what I'm curious about. I have read through this thread to try to make myself more articulate. I guess I'm thinking of it as an ingredient centered approach. The recipe is secondary to whatever is available. The idea would be the ingredients would have tags for properties. The properties would be th…

This is an interesting and complicated set of problems. It's similar to problems in the LLM & social network spaces. You have several dimensions, like recipes, ingredients, nutrition, cultural context, etc, and you have gradients to help determine recommendations, which points to a graph DB. But you also have rules when it comes to substitutions (not every substitution is appropriate for every situation), and you might have rules on other dimensions as well. That points to a layer of business logic. But to serve recommendations performantly, you might want to run rules upon writes or on a schedule to persist the results to the DB. Either that or do some sophisticated caching.

Re: Cooklang – Recipe Markup Language

#104

Earlier quoted context omitted.

I will check out Watson. I'm really just looking to tag ingredients. I could always create my own tag standards for the what I'm curious about. I have read through this thread to try to make myself more articulate. I guess I'm thinking of it as an ingredient centered approach. The recipe is secondary to whatever is available. The idea would be the ingredients would have tags for properties. The properties would be th…

This is an interesting and complicated set of problems. It's similar to problems in the LLM & social network spaces. You have several dimensions, like recipes, ingredients, nutrition, cultural context, etc, and you have gradients to help determine recommendations, which points to a graph DB. But you also have rules when it comes to substitutions (not every substitution is appropriate for every situation), and you mig…

I knew I was asking in the right place. The good news is…

The idea is not commercial in nature

The system wouldn’t need to be exhaustive. The data that is already in databases would probably suffice to get started.

The system would be tailored and refined by individuals and groups.

There would be a mechanical turk aspect for graphing/validating “recipes”.

Thanks for commenting.

Re: Cooklang – Recipe Markup Language

#105
post #68

Earlier quoted context omitted.

Because every recipe is written with the ingredients first, so you can get the ingredients ready and confirm you have the complete requirements easily.

I presume that with Cooklang, the compiler will automatically extract the list of ingredients and add it to the front.

Yes, but that makes the plaintext difficult to parse. I'll stick to Markdown.

Re: Cooklang – Recipe Markup Language

#106
post #79

Earlier quoted context omitted.

Baking is very suited to ratios, cooking less so. Bakers commonly talk about percent hydration, which is how much water there is compared to the flour.

When I started baking, the precise measurement was the first thing that I threw out. When I did things “by eye” I got better results. I think it’s because the person writing the recipe doesn’t have the same water, flour, starter or salt as you. I take the measurements as “very general guidelines”, now.

Serious American bakers mostly use Diamond brand kosher salt. Serious bakers universally will specify if they're using kosher or table or some other salt, because they pack differently and provide different effects.

You're going to be much closer following mass measurements than volume ones - your flour may have different moisture and protein levels than the author's. But those are minor compared to the >25% variations in flour when measured by volume.

Re: Cooklang – Recipe Markup Language

#107
post #40

Earlier quoted context omitted.

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. 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…

> 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.…

    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.
That isn't what I said though. Like my sibling mentions, of course you mention the ingredient. But you don't list the ingredient at the front as "2 cups of butter, melted" etc. and then in the text you say it again "Mix the two cups of melted butter with the 4 cups of sifted wheat flower...". You use short references and that's it.

    This is true for pretty much any markup language. If that's an issue for some reason then you can just use plaintext.
The point of cooklang seems to want to be to read well as plaintext though. Like markdown promises. But cooklang does not seem to succeed in that. I find the embedded ingredient with quantity markup destroys my reading flow and doesn't allow me to use the plaintext to actually use the recipe. I have to use the compiler. In markdown I find the plaintext is all I usually need/use and I never compile it to a nice looking document, except if I am trying to publish it for someone else.

    This case covers a huge number of the recipes I use, including simple ones like bread recipes.
YMMV. I don't have many such recipes and the few that do work very well in plain English.

    I'd also argue that this makes the "default case" easier, as you only need to focus on writing the actual steps involved. 
It seems like you're saying that writing a recipe is done more often than reading it. I would question that very much unless you're someone that is like a professional recipe maker.

    An argument could be made that it makes reading the markup annoying, but I need to reiterate that markup is primarily for writing. 
See above on markdown. I primarily read my `README.md` et. al. in `vi`, not through generated HTML in a browser. YMMV as always.

Re: Cooklang – Recipe Markup Language

#108
I 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.

Re: Cooklang – Recipe Markup Language

#109
post #83
post #4

> 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…

"No! Handle units! @milk{4%cup} should be trivially convertible to liters" No! That's silly and it's not how cooking works! This way you get stupid recipes like on American cooking Youtube channels that just run their volumetric measurements through a converter and end up with recipes that call for 234 grams of flour, 13.5 grams of this or that spice and 78 ml of whatever. Recipes are (well, should be) tuned to the m…

There's a simple and obviously correct answer to this problem: the markup language should support only standard SI and conversions to weird Angloamerican units should be made from those base units.

Re: Cooklang – Recipe Markup Language

#110
post #83

Earlier quoted context omitted.

"No! Handle units! @milk{4%cup} should be trivially convertible to liters" No! That's silly and it's not how cooking works! This way you get stupid recipes like on American cooking Youtube channels that just run their volumetric measurements through a converter and end up with recipes that call for 234 grams of flour, 13.5 grams of this or that spice and 78 ml of whatever. Recipes are (well, should be) tuned to the m…

There's a simple and obviously correct answer to this problem: the markup language should support only standard SI and conversions to weird Angloamerican units should be made from those base units.

The direction of conversion doesn't matter. If a recipe starts out with 300 gr of flour, and that gets converted into 1 3/4 cups + 2 tbsp, that's useless (or at least silly and cumbersome) for an imperial unit user. The whole recipe needs to be recalibrated to use imperial units, and that conversion needs to take culture (I should probably say 'locale', I'm not sure what the right term is here) into account, so that it would use 'sticks of butter' in the US and 'grams of butter' in Australia. I don't think this conversion can be automated.

My point is - recipes cannot be converted easily between unit systems. There is more to converting a recipe than applying a ratio table.

Post reply on HN