nextcloud / cookbook

馃嵅 A library for all your recipes
https://apps.nextcloud.com/apps/cookbook
GNU Affero General Public License v3.0
529 stars 89 forks source link

Support for ingredient grouping #311

Open pj83 opened 4 years ago

pj83 commented 4 years ago

Is your feature request related to a problem? Please describe. Some recipes have multiple parts to them (example here and therefore ingredients are grouped for individual parts of the meal. Currently i just have an additional ingredient line with ingredient group name in, but this makes seeing the grouping harder.

Describe the solution you'd like Ability to group ingredients for specific parts of a recipe. eg Main meal: ingredient1, 2 & 3. Sauce: ingredient 4 & 5)

Describe alternatives you've considered n/a

seyfeb commented 4 years ago

I think this has been discussed before, e.g., in #285 . Unfortunately, although I鈥檇 really like to see this feature, it seems not to be supported by schema.org.

Adding an ingredient separating the groups with an ingredient with ## in front of the text allows at least an optical separation.

## Main meal
200 g noodles
...
## Sauce
 80 g tomatoes
...
christianlupus commented 4 years ago

Just for reference:

christianlupus commented 3 years ago

I opened the PR schemaorg/schemaorg#2738 against Schema.org. If they accept it, there should be an option to group the ingredients accordingly. Until that is decided, I suggest to postpone this issue here. Then, we can decide how to proceed further.

tj551955 commented 3 years ago

Thanks for the clarification. I'm sorry, that I didn't search the issues for this, so I could have found your answers already.

seyfeb commented 3 years ago

I found an example that uses grouped ingredients. I don鈥檛 know if this conforms to the schema.org standard, but in this form we currently cannot import the recipe instructions at all:

https://leitesculinaria.com/7759/recipes-pasteis-de-nata.html#recipe

christianlupus commented 3 years ago

I just looked at it. The named recipe does only show in the website the ingredient grouping. The JSON has a straight list of ingredients.

I have not tested it but the structure is sort of awkward they use for the JSON+LD. They define a complete graph of objects and link them together. See for yourself: json.txt. It could be a problem with our parser, I might say.

seyfeb commented 3 years ago

sry I mixed up ingredients and instructions. my bad. the instructions are grouped and can't be imported correctly. however, the logic is probably the same (?)

christianlupus commented 3 years ago

What do you mean by logic? In the Schema.org standard the instructions can be of type HowToSection as in the named example. For the ingredients, no such structure is allowed. There only plain text is in the standard.

seyfeb commented 3 years ago

Okay, that I didn鈥檛 know. Then we should check why the instructions can鈥檛 be imported. The ingredients worked fine. I open a different issue for this - this doesn鈥檛 fit here.

rompe commented 3 years ago

Adding an ingredient separating the groups with an ingredient with ## in front of the text allows at least an optical separation.

Allowing Markdown as discussed in #47 would instantly make this a heading. I would love this!

christianlupus commented 3 years ago

Allowing Markdown as discussed in #47 would instantly make this a heading. I would love this!

You have to distinguish between ingredients and instructions. Here we are discussing things related to ingredients. The problem is the need of structure but the missing support by the standard. I will have a look there. The trick with ## is just a workaround until a valid structure is settled.

In #47 the main point is adding images (the storage is an extended issue in this context) and related to instructions.

BTW with #381 the description will be able to use markdown as well.

rompe commented 3 years ago

In #47 the main point is adding images (the storage is an extended issue in this context) and related to instructions.

I understood https://github.com/nextcloud/cookbook/issues/47#issuecomment-527124798 as if Markdown should be allowed in ingredient fields as well. Reading it again now I think I got that wrong and, in fact, #47 is completely unrelated.

BTW with #381 the description will be able to use markdown as well.

That's wonderful! Now just rendering markdown in any text field (read: ingredients as well) would do the trick for me, especially since it seems to be >80% result with <20% afford and it wouldn't stretch the standard too much.

christianlupus commented 3 years ago

That's wonderful! Now just rendering markdown in any text field (read: ingredients as well) would do the trick for me, especially since it seems to be >80% result with <20% afford and it wouldn't stretch the standard too much.

Please open a new feature request to keep track of that wish.

schaarsc commented 2 years ago

there appears to be no progress on the relevant schema.org issues https://github.com/schemaorg/schemaorg/issues/2628 and https://github.com/schemaorg/schemaorg/issues/882

to be able to continue to enhance/develop nc/cookbook, would it be an option to store recipes in the cookbook assuming https://schema.org/recipeIngredient: https://schema.org/ProductCollection or https://schema.org/TypeAndQuantityNode or https://schema.org/Text?

mkaut commented 6 months ago

It looks like one can achieve a visual separation of groups by using for ex. _Group name_ in the ingredient list. The only problem is that Cookbook than prints a warning about incorrect syntax (item not starting with a number). Would it be possible to not print the warning if the ingredient start with some specified character (for ex. _)? This could be used as a quick fix, until the schema improves...

seyfeb commented 6 months ago

I would recommend using ## for ingredient-group titles. This should also prevent calculation errors (at least on the current master branch - not sure if it's already released).