def generate():
    r = Recipe('Cuban Beans and Rice')

    r.ingredient('olive oil', Tablespoon(3))
    r.ingredient('onion', 1, 'peeled and chopped')
    r.ingredient('carrot', 1, 'in 1/4-inch slices')
    r.ingredient('garlic', 4, 'minced')
    r.ingredient('short grain brown rice', Cup(0.75))

    r.ingredientGroupDivider()
    r.ingredient('water', Cup(3), 'about 1/3 less if using white rice')
    r.ingredient('dry black beans', Cup(1), 'washed and soaked for 2+ hours')

    r.ingredient('salt', Teaspoon(1))
    r.ingredient('black pepper', Teaspoon(0.25))
    r.ingredient('ground cumin', Teaspoon(1), 'or more to taste')
    r.ingredient('cayenne', Teaspoon(0.25))

    # option 3 (Danni's)
    r.ingredient('bay leaves', 1)
    r.ingredient('coriander', Teaspoon(0.5))
    r.ingredient('\\emph{smoked} red pepper flakes', Teaspoon(1))
    r.ingredient('cilantro', Cup(0.25), 'chopped, including stems')

    r.ingredientGroupDivider()
    r.ingredient('red bell pepper', 0.5, 'cut into chunks')
    r.ingredient('lime (juice of)', 1)

    r.doubleRecipe()


    r.description('Inspired by the Swiss pressure cooking cookbook, revised by Danni')

    r.addInstruction('''
        Heat olive oil over medium high heat in pressure cooker.
        Add onion, garlic, and carrot if you are including one. Sautée until onion softens.
        Add rice over high heat, stirring often, until lightly golden.

        Add water and soaked, drained beans. Stir in salt, pepper, herbs, and spices.
        Close lid and bring pressure to first ring over high heat.
        Cook for 22 minutes on the first ring.

        Use the natural release method.
        When the pressure releases, add the red bell pepper chunks and the lime juice.
    ''')
    r.addInstruction('Serve with plain yogurt.')

    r.yieldPerBatch(4, 'servings')

    return r.generate('cubanBeansAndRice.pdf')
Beispiel #2
0
recipe = Recipe('Crepes')

recipe.doubleRecipe()
recipe.tripleRecipe()

recipe.ingredient('Flour', Cup(1), 'in order of preference: whole wheat pastry, white whole wheat, bread')
recipe.ingredient('Eggs', 3)
recipe.ingredient('Milk', Cup(1.25), 'mix in some buttermilk or kefir for flavor')
recipe.ingredient('Canola oil', Tablespoon(1))
recipe.ingredient('Salt', Teaspoon(0.5))
recipe.ingredient('Sugar', Teaspoon(1))

recipe.description('French style crepes, which are very good with either sweet or savory ingredients.')

# note: should covert 1/3 to \nicefrac{1}{3}
recipe.addInstruction('''
Mix all the ingredients thouroughly with a hand mixer (preferred), or in a blender
until you get a uniform batter with the consistency of cream. After mixing,
let it sit about 10 minutes and add milk as necessary (if it thickens).
Pour about 1/3 cup batter in an evenly-heated flat pan, after a small amount of
butter has been melted in it.

Cook the first side until it smells like bread,
and the second side only for about 10 seconds.
''')

recipe.yieldPerBatch(10, 'crepes')

if __name__ == '__main__':
    recipe.generate()
# (there is no restriction on what can be identified)
# EX:   recipe.ingredient('brown rice', Cup(1.5, 'overflowing'))
#       recipe.ingredient('kale', Bunch(1, 'large'), 'chopped')
recipe.ingredient('apples', 3, 'galas, preferably')
recipe.ingredient('bosc pears', 2)

recipe.ingredientSpace() # to add white space
recipe.ingredient('salt', None, 'to taste')

recipe.ingredientSection('Topping') # to have a titled ingredient section
# all subsequent calls to ingredient() will be added to the "current" section ('Topping' in this case)
recipe.ingredient('chocolate chips', None, 'a handful should do')


recipe.paragraph('''
    A paragraph of instructions. Add as many as you like.
''')

# yield: either (amount) or (amount, description)
# recipe.yieldPerBatch(10, 'crepes')
recipe.yieldPerBatch(FluidOunce(80))


# prints additional "quantity" columns and yield amounts
# recipe.double()
# recipe.triple()
# recipe.quadrouple()

if __name__ == '__main__':
    recipe.generate(splitext(__file__)[0] + '.pdf')