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

Import json (schema.org) and keep individual steps #3366

Closed
Kiwifed0r opened this issue Oct 15, 2024 · 8 comments
Closed

Import json (schema.org) and keep individual steps #3366

Kiwifed0r opened this issue Oct 15, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@Kiwifed0r
Copy link

Is your feature request related to a problem? Please describe.

I have a collection of recipes as PDF, images etc. and do not want to enter them manually. Existing tools (LLMs) make it relatively easy to extract the content of the files into json files with individual steps and ingredients attached to those steps. I can import the recipes this way but I loose the individual steps and get a recipe with one step and all ingredients attached to that step. I looked through the existing issues and found that this seems to be on purpose.

Describe the solution you'd like

Would it be possible to change this behavior and keep the individual steps with ingredients? Or is this already possible and I missed the correct way to achieve it?

Describe alternatives you've considered

No response

Additional context

No response

@Kiwifed0r Kiwifed0r added the enhancement New feature or request label Oct 15, 2024
@smilerz
Copy link
Collaborator

smilerz commented Oct 15, 2024

duplicate #3253

@smilerz smilerz closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2024
@Kiwifed0r
Copy link
Author

I understand that websites don't use multiple steps in a consistent manner. But importing json directly is different. And it does not have to be json. I would also be happy to know what format would be best to import recipes with multiple steps. Then I could transform the json to that format and import the recipe that way.

And considering that a number of people asked how it would be possible to add recipes from PDFs and images, this seems to be something that would help a number of people.

@smilerz
Copy link
Collaborator

smilerz commented Oct 15, 2024

It's not different because recipe sites describe their recipes in json which the importer parses. The josn+ld format doesn't support multi-step recipes and neither does the recipe scraper.

@Kiwifed0r
Copy link
Author

Kiwifed0r commented Oct 15, 2024

I'm just trying to understand what I can do in order to make this work.
I'm not talking about scraping recipes. I'm talking about importing recipes which are already in a known format, for example, schema.org which defines recipes with multiple steps. And I thought it might be one way to use a different parser to parse recipes in that format if the user wants to do that.
And if that is not the right way, then my question is, which format would be best to use. For example, when I export a recipe using the default format, then I get the recipe.json file with multiple steps and I can import that recipe again and get multiple steps. So I guess one way would be to transform my recipes into that structure and import them that way.

@smilerz
Copy link
Collaborator

smilerz commented Oct 15, 2024

Scraping recipes uses the schema.org format (which doesn't have a format for multi-step recipes). I don't know how to state it any more clearly.

The import page has the method to split instructions and move ingredients between steps.

@Kiwifed0r
Copy link
Author

Kiwifed0r commented Oct 15, 2024

Maybe I'm reading the documentation from schema.org wrong, but the description of recipeInstructions says:

A step in making the recipe, in the form of a single item (document, video, etc.) or an ordered list with HowToStep and/or HowToSection items.

And again my question from before: If json-ld is not the correct format, then what would be the way to achieve this so I don't have to do it manually?

@smilerz
Copy link
Collaborator

smilerz commented Oct 15, 2024

Maybe I'm reading the documentation from schema.org wrong, but the description of recipeInstructions says:

A step in making the recipe, in the form of a single item (document, video, etc.) or an ordered list with HowToStep and/or HowToSection items.

Those 'steps' aren't steps in the same way that Tandoor uses steps. If you use HowTo steps, even instructions that are part of the same 'step' are listed separately.

And again my question from before: If json-ld is not the correct format, then what would be the way to achieve this so I don't have to do it manually?

You can write a script that utilizes the API.

@Kiwifed0r
Copy link
Author

Thank you! I will use the API then.

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
None yet
Development

No branches or pull requests

2 participants