cooklang / cookcli

Command line program which provides a suite of tools to create shopping lists and maintain recipes.
https://cooklang.org
MIT License
745 stars 33 forks source link

Add option to show quantities next to ingredients in recipe text #91

Closed leonbeon closed 9 months ago

leonbeon commented 9 months ago

This PR adds the ability to show ingredient quantites with their units next to the ingredients in the recipe text. It also adds a new "Preferences" route and navigation element to toggle the display of this new setting. This is just quickly added by me to use the feature at all, this may need a seperate issue to handle how preferences are accessed. The new option is also saved to local storage and retrieved if found.

I think this change is very useful for recipes where you need the same ingredient multiple times. Consider a recipe of mine where I need 225g of butter in the beginning and then later at a different step I need 115g again. In the recipe listing, these are two different entries:

Two ingredients with the same name

But in the recipe itself, I have no way of differentiating which quantity of "butter" is supposed to be used without writing it manually (which would clash with serving size scaling). With the PR, the text now shows the unit size with the ingredient itself:

Quantities next to ingredients

And for completeness, this is the preferences pane: Preferences

dubadub commented 9 months ago

Nice! Thank you @leonbeon!