cproctor / cookbook

A simple command line tool for planning, shopping, and cooking
75 stars 4 forks source link

Add scaling to quantities within recipe steps #4

Closed cproctor closed 5 years ago

cproctor commented 5 years ago

Sometimes recipes need to refer to amounts of an ingredient. It would be nice if there were a way to interpolate these values so they could scale with recipes. Proposal: When a recipe step contains stir in {0.5, c, turnips} and it's scaled by 2, the resulting text should be stir in 1 cup turnips.

cproctor commented 5 years ago

This is actually going to require some reworking. Right now, recipes don't have any notion that they're being scaled--that's taken care of by the MenuRecipe model. So when we get the string value of a recipe, we need to be able to pass a scale argument.

cproctor commented 5 years ago

Done!

cproctor commented 5 years ago

Well, sorta. It would be nicer to use the full RecipeIngredient process of scaling and then converting units (so that if you're cooking for a crowd, you're not measuring out 100 teaspoons of something)