Help: #howto Build Recipe "database" in Obsidian (complex)

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