org-chef
org-chef copied to clipboard
Option to convert in metric systems
It would be nice to add an option to convert from american units like cups, pounds, ounces etc. into metric measurements such as liters, grams etc..
I would love to add a feature like this! I have thought a little bit about this, but there are some issues that I would have to sort out first.
It would be really nice if it could automatically convert for you, but maybe that's a bit dangerous because I don't think it can be perfect (though, it can probably be pretty good).
- Probably going to need something to actually parse the ingredients... Right now I just grab them as strings.
- Lots of different forms that this can take... 1 - 2 tbsp, 1 1/2 tbsp, 1 - 1/2 tbsp, 1 + 1/2 tbsp... Who knows, the real world is a messy place.
- I think ounces can be somewhat ambiguous -- either it's fluid ounces or weight ounces, and I don't think this is always distinguished by something like "fl. oz"... Need to know what an ingredient is.
- Converting to weights needs to know the density of ingredients if it's measured by volume normally
For (2), I'm welcome to any suggestions for how to distinguish between "liquid" ingredients and "by weight" ingredients (maybe we just ask when it's ambiguous, and try to make a list of them)....
For (3), I am also welcome to suggestions for how to get conversions from volume to weight.
I know you might just want to convert cups and whatnot to ml, but I think it would also be nice to be able to convert all recipes to recipes by weight!
Also! Might be worth seeing if there is an elisp library for handling unit conversions, and if not maybe making one?
You can use emacs calc to do a lot of this. See https://gitlab.com/egh/org-cook/tree/master for how it can be done.