[uf-discuss] hRecipe implementation

Ted Drake tdrake at yahoo-inc.com
Mon Aug 18 08:03:23 PDT 2008


Hi
During one of the internal Yahoo Hack Days, I created an hrecipe format
prototype for Yahoo Food. I'd be happy to share what I put together. I
wouldn't call it finished, but it may give you some ideas and would be good
to synch.

Ted Drake
Yahoo

-----Original Message-----
From: microformats-discuss-bounces at microformats.org
[mailto:microformats-discuss-bounces at microformats.org] On Behalf Of Mark
Wunsch
Sent: Monday, August 11, 2008 1:47 PM
To: microformats-discuss at microformats.org
Subject: [uf-discuss] hRecipe implementation

Hi everyone,

I'm a front-end developer currently working on a high-visibility
website that specializes in Food and Cooking. The team I am working
with is very excited about implementing microformats.

One microformat we are going to be implementing is hRecipe -- a
format-in-progress according to the wiki (
http://microformats.org/wiki/recipe-brainstorming). We will be using a
variation of this draft and we want to put it forward for community
digestion (pun intended).

This is what we will be deploying at launch and we are open to
suggestions to further the format:
The recipe root container is class "hrecipe"
The title of the recipe is required: "recipe-title"
The recipe author will use the class "author" and be written as an hcard.
"recipe-summary" indicates a container for any notes or information
about the recipe, including
"difficulty"
"cook-time"
"prep-time" (Preparation time)
"wait-time" (i.e. Put these in the fridge overnight)
"published" (date published)
"yield" (serves how many?)

The ingredients should be placed within "ingredients". Within
"ingredients" are "ingredient" and that is further broken up into
"quantity" (which contains "unit") and "item". An ingredient can also
have a note, declared by class "note". An example of note is in a
recipe that calls for an ingredient to be prepared a certain way:
<ul class="ingredients">
    <li class="ingredient">
        <span class="quantity">4 <span class="unit">cups</span></span>
<span class="note">sliced, peeled</span> <span
class="item">peaches</span>
    </li>
</ul>

An ingredient with a class of "option" denotes an optional ingredient,
otherwise it is to be considered a required ingredient for the recipe.
A recipe MUST have at least one required ingredient, however
"quantity" is not required. Furthermore, within "ingredient" you can
also make a class of "alternate" and include "quantity" and "item"
within that. So for example, you would want a tablespoon of butter
that you could substitute for margarine you would say:

<li class="ingredient">
    <span class="quantity">1 <abbr class="unit"
title="Tablespoon">tbsp</abbr></span> <span
class="item">butter</span>.
    <div class="alternate">
        <span class="quantity">1 <abbr class="unit"
title="Tablespoon">tbsp</abbr></span> <span
class="item">margarine</span>.
    </div>
</li>

After ingredients, "method" is the containing class for the directions
of the recipe. This MUST be present.
Furthermore, you can include an image with class "photo" to be used as
an image of the recipe.
Recipes can be tagged with rel=tag, and license information can be
shown with rel=license. We will also be integrating hReview with our
recipes.

We hope that by settling on these conventions and moving forward, we
can help propel the hRecipe format from a brainstorming session to an
in-practice specification.

Thanks,
Mark Wunsch
mark at markwunsch.com
_______________________________________________
microformats-discuss mailing list
microformats-discuss at microformats.org
http://microformats.org/mailman/listinfo/microformats-discuss



More information about the microformats-discuss mailing list