Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ingredient grouping #311

Open
pj83 opened this issue Aug 23, 2020 · 16 comments
Open

Support for ingredient grouping #311

pj83 opened this issue Aug 23, 2020 · 16 comments
Labels
enhancement New feature or request

Comments

@pj83
Copy link

pj83 commented Aug 23, 2020

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

@pj83 pj83 added the enhancement New feature or request label Aug 23, 2020
@seyfeb
Copy link
Collaborator

seyfeb commented Aug 26, 2020

I think this has been discussed before, e.g., in #285 . Unfortunately, although I’d 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
Copy link
Collaborator

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
Copy link

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
Copy link
Collaborator

seyfeb commented Dec 7, 2020

I found an example that uses grouped ingredients. I don’t 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
Copy link
Collaborator

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
Copy link
Collaborator

seyfeb commented Dec 7, 2020

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
Copy link
Collaborator

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
Copy link
Collaborator

seyfeb commented Dec 7, 2020

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

@rompe
Copy link

rompe commented Feb 2, 2021

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
Copy link
Collaborator

christianlupus commented Feb 4, 2021

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
Copy link

rompe commented Feb 7, 2021

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

I understood #47 (comment) 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
Copy link
Collaborator

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
Copy link

schaarsc commented May 8, 2022

there appears to be no progress on the relevant schema.org issues schemaorg/schemaorg#2628 and schemaorg/schemaorg#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?

  • Cons
    • not within the standard
    • imported recipes would still use Text
  • Pros
    • support grouping itmes (for recipes created by nc/cookbook)
    • support list without grouping
    • store quantity in structured format (for recipes created by nc/cookbook)
    • based on the structured format UI can make use of it, for example to right-align quantity and left-align description
    • once schema.org provides a new standard, data stored in structured format can be converted

@mkaut
Copy link

mkaut commented Mar 20, 2024

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
Copy link
Collaborator

seyfeb commented Mar 20, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

7 participants