techhat / openrecipeformat

Specs and Examples for the Open Recipe Format
Other
140 stars 29 forks source link

Support for images in open recipie format #11

Open costrouc opened 7 years ago

costrouc commented 7 years ago

Was wondering if there was interest in including images in the recipie format? A simple way to do this would be to base64 encode to images.

techhat commented 7 years ago

When I first came up with the idea of ORF, I had wanted to make it a zip file, like the open document formats that LibreOffice uses, so that media could be stored inside.

At the time we were looking at XML to follow suit with those formats, but YAML is much simpler to write and maintain. Then there's the problem with people making huge ORF files embedded with all sorts of binary data.

Eventually I tentatively decided that including URLs to media, rather than the actual media itself, would address these issues while still allowing for media to be associated with recipes.

@costrouc what are your thoughts on this?

costrouc commented 7 years ago

I really appreciate the YAML format exactly because it is easy to read. Since urls are allowed you got me thinking that there is already support for images. Images can be included via a datauri. So I'd say it's solved.

I have looked at the documentation and spec. What field would be used for the media url? Can't find it.

Why I care is that I was considering to make an Polymer web component that would render these recipes (would be nice to have an image with each). Maybe will attempt this at a hackathon.

DO1JLR commented 3 years ago

Hello together

Any updates or progress here yet?

For my recipe collection, there are pictures showing the finished recipe as well as pictures of some of the steps. I would find that cool to include in the openrecipeformat. But if that's not desired I guess I'll limit that to the html version of the recipe....

telepath commented 1 year ago

In the current definition, you can add notes to each ingredient, step or recipe. These are fields for free text, so you can add either a link to an image or an image as a datauri.

      notes:
        - https://upload.wikimedia.org/wikipedia/commons/5/56/Tiger.50.jpg

The open question is if you're supposed to format the link in a specific way. Two obvious methods come to mind, either HTML or Markdown. Markdown Links and images would fit quite well into the YAML format, as long as you quote the string:

      notes:
        - "![](https://upload.wikimedia.org/wikipedia/commons/5/56/Tiger.50.jpg)"

HTML would make redering a web page quite simple and can be included without quotes or in single qoutes (because double quotes are usually used for attributes):

      notes:
        - '<img src="https://upload.wikimedia.org/wikipedia/commons/5/56/Tiger.50.jpg" />'