cooklang / cooklang-import

A command line tool to import recipes into Cooklang format
MIT License
32 stars 12 forks source link

Don't mark amount of ingredient as 0 when amount is not specified. #22

Closed bubonicfred closed 2 years ago

bubonicfred commented 2 years ago

When an undefined amount is given in a recipe, the importer defines the amount as 0, correct output should be to pass on the undefined amount. Example URLs: Herb Butter for salt amount Tikka Masala

Expected output @salt or @salt{} Actual output @salt{0}

bubonicfred commented 2 years ago

Realised there are cases where unit is specified but amount is not (e.g. pinch of something) should probably set amount as 1 in those cases?

nicholaswilde commented 2 years ago

Expected output @salt or @salt{} Actual output @salt{0}

For some reason I thought that @salt{0} would produce a some in the cook output but I was wrong. It does look like it produces a 0 in Ingredients.

...
Ingredients:
    salt                          0
...
nicholaswilde commented 2 years ago

Realised there are cases where unit is specified but amount is not (e.g. pinch of something) should probably set amount as 1 in those cases?

Would you rather see pinch instead of some? I feel like we'd have to look for specific unit key words and insert the 1. Are there other unit key words besides pinch that we might need to do this for?

@dubadub what are your thoughts?

bubonicfred commented 2 years ago

Would you rather see pinch instead of some? I feel like we'd have to look for specific unit key words and insert the 1. Are there other unit key words besides pinch that we might need to do this for?

Specifying @salt{%pinch} shows as some pinches in the ingredient list, I honestly don't know if I'd rather see some , some pinches or 1 pinch It does not help that pinch can be used as an actual unit (I have some small measuring spoons for this) Off the top of my head, dash, drop, sprinkle.