CookCLI icon indicating copy to clipboard operation
CookCLI copied to clipboard

Be able to provide a range of values for quantities, times

Open shayaknyc opened this issue 3 years ago • 2 comments

Sometimes, a recipe isn't exact and would require a range of quantities like 1-2 tablespoons, or 12-15 minutes. There doesn't appear to be an elegant way to accommodate something like this. While there are some "workarounds" in the instructions section, such as:

~bake{12%minutes} - 13 minutes

What renders in the "Timers" section is just "bake (12 minutes)". Similarly, if a dough needs 1-2 tablespoons of water, adding as needed to adjust for environmental factors (altitude, humidity, etc) the steps will only allow to define a single quantity such as @water{1%tablespoon}. Would be great to see this implemented. Unless there's something I'm missing?

shayaknyc avatar Mar 15 '22 18:03 shayaknyc

@shayaknyc there's some (simple) support of ranges in CLI. For example for ingredients and timer:

$ echo "Add @baking soda{1-2%tsp} and leave for ~{5-10%minutes}" | cook recipe read
Ingredients:
    baking soda                   1-2 tsp

Steps:
     1. Add baking soda and leave for 5-10 minutes
        [baking soda: 1-2 tsp]

It's not smart in a way that interpreted like string and in shopping list it won't combine with other references of baking soda.

dubadub avatar Mar 16 '22 20:03 dubadub

I see....gottit. I think the issue I was having is that I'm primarily using the CookLang Editor extension in Obsidian, and I think it parses the code a little differently when it displays. If I type ~pickling{12-24%hours} in Obsidian, it renders literally ~pickling{12-24%hours} instead of showing the time as a range. The CLI doesn't seem to output the timer at all tho....

It does work with ingredient ranges though, so thank you - I see that working.

shayaknyc avatar Mar 21 '22 14:03 shayaknyc