Chobbes / org-chef

A package for making a cookbook and managing recipes with org-mode.
MIT License
327 stars 33 forks source link

Option to convert in metric systems #4

Open tollerm opened 6 years ago

tollerm commented 6 years ago

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..

Chobbes commented 6 years ago

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).

1) Probably going to need something to actually parse the ingredients... Right now I just grab them as strings.

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?

egh commented 6 years ago

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.