Live data from Hacker News

Cooklang – Recipe Markup Language

cooklang.org

1–10 of 112 posts

Re: Cooklang – Recipe Markup Language

#2
Pretty 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!

Re: Cooklang – Recipe Markup Language

#3
This 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)

Re: Cooklang – Recipe Markup Language

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

Re: Cooklang – Recipe Markup Language

#6
post #2

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

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

Re: Cooklang – Recipe Markup Language

#7
post #3

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

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

Re: Cooklang – Recipe Markup Language

#8
post #2

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

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

Re: Cooklang – Recipe Markup Language

#9
Jumping 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!

Re: Cooklang – Recipe Markup Language

#10
Putting 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-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.

Post reply on HN