cooklang / cooklang-obsidian

Edit and display CookLang recipes in Obsidian
MIT License
215 stars 16 forks source link

Combine multiple distinct ingredients into single entry #8

Open RichSteele opened 3 years ago

RichSteele commented 3 years ago

If I have multiple uses of the same ingredient in the same recipe I'd prefer if the total was combined, perhaps with an optional "divided" annotation on the ingredient.

So, for example, if I have a recipe like:

Crack the @eggs{3} into a blender, then add the @flour{125%g}, @milk{250%ml} and @sea salt{1%pinch}, and blitz until smooth.

Separate @eggs{2} into separate bowls.

I get an ingredients list that looks like:

I'd prefer to see something like:

deathau commented 3 years ago

This is definitely something I want to achieve at some point, but there are some things that need thinking through:

snird commented 2 years ago

I add a +1 to this.

I'll also add this issue is relevant to cookware too, If a cookware appears more than once in the instructions, it'll appear more than once in the list.

As for the units question, I think a naive implementation to start with will be good enough. Meaning, if the units are the same, combine them. Otherwise, keep them separate. When this project will get to do unit conversions, the issue of smarter handling can be discussed again