Super excited to see where this goes ! I would love to see the graph view when lots of recipes are added. I love the breakdown in the uploaded ZIP and im going to give it a try as well.

Data view is just great to open up the fridge, see what is in there and get pointed to the stuff you can make.

For preparing the food, there is the ‘presentation view’ that you can have a look at. You can also throw in images easily to make it nicer.

My recipes are currently stored in Google Keep so I’m going to look for some kind of bulk export.

1 Like

Unfortunately it looks like there are some security issues preventing communicating with Paprika. I’ll keep playing with it, but it doesn’t look like it’s going to be possible.

Ohhh, bummer :smirk: … sorry to hear that Jeremy @valentine.195

The diaeresis is used when you can read the two vowels next to each other as one sound. To prevent this, the diaphragm is used.

USE
The diaeresis is placed with the following 14 letter combinations: ee, ei, eu, ie, aa, ae, ai, au, ui, uu, oe, oi, oo and ou.

Example: poëzie, reünie, koloniën, ruïne

Rule 1 is an exception if words end in the French and Spanish letter combinations: eum, ien, eus and ei
Example: petroleum, opticien

If there are more than two vowel combinations, the vowel after the i will not have a diaeresis – the e and i that follow it will have a diaeresis.
Example: begroeiing, aaien, knieën, mozaïek, geëerd

A diaeresis is placed with numerals
Example: tweeëntwintig, drieëndertig

The diaeresis only occurs in non-compound words
Example: it is na-apen and not naäpen, it is zee-egel instead of zeeëgel

Words that end in an unstressed ie get in the plural: iën.
Example: koloniën, provinciën

Words that end in stressed ie get in the plural: ieën
Example: knieën, industrieën, melodieën

Another exception (besides rule 2) is that there is no diaeresis if there is a suffix. You then write lila-achtig, instead of lilaächtig.

Hi Michael, I don’t remember exactly, but Matthias told me something like that everything that is dynamically generated, will not be part of the graph view. Haven’t tried it yet, because I am still trying to master the Dataview(js) and making changes etc and it is really difficult for me, as I had no prior knowledge of scripting and coding. I am slowly learning by trial and many many errors :stuck_out_tongue: but I am happy to find (lots of) help here!

I have already made a template for the recipe and for the ingredients, and included a placeholder image. I gave up translating the english words in the code to Dutch, because it makes no sense really - I discovered none of those words end up in the actual note as text, they’re just used to calculate stuff.

Hi Matthias :grinning:

A (hopefully small) request/question:

Is there a way to autocalculate the ingredients per portion and make it populate the ingredients section in the YAML?

I would have to calculate that for thousands of recipes. Also, not every recipe states the amount of portions. I don’t know how to manage the ingredients in that situation. Estimate the amount of portions?

Quite time-consuming to calculate that by hand, where pasting in just the amounts mentioned in the recipe would be a no brainer.

portions: 4

ingredients:

  • [“sugar, white”, 20 g]
  • [watermelon, 286 g] # 1 wedge

The idea was to specify the ingredients per portion, and the recipe template already multiplies that by the number of portions you specify in the YAML. Try changing just the YAML portions variable and see what happens! (Closing/opening note might be required due to Dataview’s caching.)

Most recipes given in cookbooks here are for 4 portions. In this case, I just divide by 4 and enter that as the ingredient amount (sometimes ending up with something like 1.25 eggs, but what the heck).

You could of course go and modify the code to do the reverse, i.e. giving ingredients per x portions, and divide.

I understand the idea, and it’s working really well, of course I tried it after you told me the code can do that :slight_smile: :blush:

I wouldn’t know how to change the code, but I will try to see if I understand what the code actually says that it will do. I guess * means multiply, I remember that much from 45 years ago in Math class. And divide was / if I remember correctly.

1 Like

In any case, for later calculations, it makes sense to base things on always the same size (i.e., 100 g, 1 serving, etc.). Otherwise you’ll find that combined calculations, say combined GL or calories for a serving or complete recipe, will turn out almost impossible.

That’s the main reason I used “100 g” for GL and cal, and “1 portion” as a base for the recipes.

I know this can be a lot of work. Maybe if most of your recipes are already in Paprika, you can have that calculate the values and then copy to Obsidian?

Most of my recipes are still txt, docx or pdf based and not in Paprika. Paprika has about 100 or something.

I understand what you are saying about the 100g and 1 portion etc.

I just added the ingredients and the recipe for a Citroen MugCake. I followed the Melon Salad recipe and its ingredients precisely, I think I checked 100 times if it were indeed the same. It should be (and is!), as I ran the note off a template that is based on the Melon Salad recipe and that recipe and those ingredients work.

The only thing that is different, is that I didn’t use grams for the ingredients but tbsp and tsp. Because that is what is in the recipe. At first I added the Dutch equivalent of tbsp and tsp (el and tl) as units, but the code give a looooong error.

So I changed that in both the ingredients notes and the recipe note to tbsp and tsp. Same error.

I used things like 0,5 tbsp and thought, maybe it needs to be 0.5 tbsp. What do you know…it started working! <= these are the things that are not always obvious to me…why doesn’t it take 0,5 ?

After this, I could use my own units too. I have a pdf for you to see how I styled everything. Citroen MugCake

You can probably just drag-n-drop the PDF into the forum edit box.

Traditionally, programming languages are mostly using English terms, and also English number formats. That’s why I didn’t bother and just use them internally. For displaying, numbers could theoretically be converted to the number format of the language the system or Obsidian uses. But again I didn’t bother since it’s just an example to get started.

You could, for instance, in the recipe dataviewjs, replace the line

list.push(amount * dv.current().portions + " " + unit + " " + link);

against

list.push((amount * dv.current().portions).toLocaleString(moment.locale(), {maximumFractionDigits: 1}) + " " + unit + " " + link);

and it would magically output numbers (in the ingredients list) according to whatever language you’ve set Obsidian to:

Auswahl_021

EDIT: Unfortunately this is currently broken in my 0.12.4 installation.

Also, to make sense of all the units and get nutritional values out of them, conversion functions need to be written. Nothing is “automatic”, and a computer will blindly do what it is told. So for things like “piece”, “tsp” or “tbsp”, it would need to know if it’s a fluid or mass measurement, and the conversion values. A rather complicated undertaking.

Looks quite nice already, your mug cake PDF!

Btw, looks like you use an older version of the recipe template, where the ingredients have a large line spacing. I modified that later (somewhere in this thread) to use less line spacing.

1 Like

The ine spacing thing was indeed one of the things I wanted to ask. Obsidian sometimes makes them big too, but then when I close and re-open the note, it’s okay again.

It’s not so much a bother, the dot or the comma in the numbers. It was just that I discovered that this was the mistake I made to break it all (seemingly) :slight_smile: but, I will try to see if I can implement what you wrote above and make them appear as a euopean notation with a dot for thousands and up and a comma for below and for not-whole numbers.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

I know this originally started as a help thread, but I think the contents can continue to be discussed and/or other users might want to contribute/ask/share their own versions, so I’m moving this to #share-showcase and reopening the thread.

Cheers!

4 Likes

Thanks! I want to investigate this myself once I get some less important stuff out of the way.

Hah, great thread this. Both entertaining and educating read. Thanks to all involved! :smiley:

Also my thanks for these :slight_smile: its a cool idea
@Moonbase59 or @FiekeB can someone of you help me?
i only have two problems at the moment, i copied your zip into a new vault and wanted to try it out, you already have the melon salat recipe in your more or less template. but the recipe dont get shown in both TOCs, i also have installed the dataview addon and enabled inside it the javascript queries and the inline queries. but its still dont work, can you help me? It says following: “Dataview: Query returned 0 results” for reciepes and the TOC for the incredients didnt give any message out its just the title.
FYI im using obsidian 0.12.15

and the second is that i cant find the line.push… code in any dataview script block from your post 40 to change it (even when i didnt understood completly what it should do :smiley:

or did you already have since than even more awesome ideas for the reciepbook inside obsidian and want to share it with the community :slight_smile:

okay, i found out the problem, you have in the zip file no folder with the name “recipe” but you search in both TOC searches inside the folder “recipe” AND for a tag. but the folder eg for the food reciepes is “food” and not reciepe :smiley:

the second of my question: i seen that, in the message 19 from Moonbase59 (where the zip is attached) he have written in the recipe template

list.push(amount * dv.current().portions + " " + unit + " " + link

and in the zip is standing

dv.paragraph("- " + amount * dv.current().portions + " " + unit + " " + link

but i still dont understand the difference between them :frowning:

ADVANCED
Hi all
I have fiddled a little at a recipe repository and have gotten inspired by this thread (and the recipe app i am otherwise using and will delete once my recipes are all imported into Obsidian); so thanks @FiekeB for the idea and @Moonbase59 for some of the implementation ideas/considerations.
I just wanted to lay out the solution that i have implemented as a thank you and hopefully this can be helpful. The solution, however, require a basic understanding of JavaScript. I’ll try to be as explicit as possible tho.
Hopefully this can be helpful for some users - and can be declined for other types of library management (books, movies, games…)!

Requirements
dataview/customJS/MetaEdit/Buttons

Structure

  • 1 note per recipe
  • 1 (or several) aggregation note
    (no ingredient note…)

For my own purpose, I have tried to be as flexible as possible to accommodate different recipe writing styles and sources.
I will break down this post in different posts: the recipe page; the aggregation page; backend

1 Like