nextcloud / cookbook

🍲 A library for all your recipes
https://apps.nextcloud.com/apps/cookbook
GNU Affero General Public License v3.0
507 stars 86 forks source link

Add support for `suitableForDiet` property to indicate dietary restrictions #2180

Open nicodemusjls opened 4 months ago

nicodemusjls commented 4 months ago

I'd like a new option added to the drop-down list of "Nutrition Information". Please add "Dietary Restriction Compliance" or similar as a way of adding a list of dietary restrictions that the recipe is complaint with. In use, we would select this new option then manually type the list of allergens it doesn't have or diets it conforms to. I know we can use the "categories" section to get a similar function, but I think this is better kept out of the other types of categories AND it should print along side the Nutrition Information section.

Example: Dietary Restriction Compliance- peanut allergy, nightshades allergy, vegan, vegetarian

Further, it would be awesome if the text box also worked just like the categories item works, where we can select from existing or add new phrases. However, as a quick, partial fix, we could just have the option added with a standard text box.

seyfeb commented 4 months ago

Thank you for your suggestion. We follow the https://schema.org/Recipe for structuring the information. The NutritionInformation object does not contain dietary information but only the nutritional values.

If I understand you correctly your requested feature might be achievable using the suitableForDiet field.

jessebot commented 1 month ago

Came here when searching the issues for suitableForDiet, which I'd like to see added. It uses the following values from RestrictedDiet:

@nicodemusjls I think this is probably what you need anyway, so this issue title could be updated to say "Support suitableForDiet".

nicodemusjls commented 1 month ago

That field name would work, but I'd additionally need the items to not be hard coded. My wife and kids have various uncommon allergies and needs. I'm needing a field that would allow custom entries be added as well. That field would be perfectly appropriate if I had a way to add my own custom items.

nicodemusjls commented 1 month ago

I was originally thinking of the Nutritional Info section as I was thinking like "High in Vitamin C" and similar. But, suitableForDiet would work great as long as I can add my own items.

jessebot commented 1 month ago

@nicodemusjls since this project uses the https://schema.org/Recipe schema, I think the next step would be to submit your family's allergens as suggestions to https://github.com/schemaorg/schemaorg for the suitableForDiet field within Recipe. I think the field is mostly used for restrictive diets (SoyFree would be an example if your family has an allergy to soy), rather than optimized diets (HighInVitaminC would likely not be supported), but there's also a chance you could chat with the schema.org folks to talk about making this field just Text, or allowing additional suggestions. Disclaimer: I'm not a maintainer at either of these repos. I just wanted to help. Good luck either way :pray: