[uf-discuss] hRecipe implementation
Mark Wunsch
mark at markwunsch.com
Mon Aug 11 13:46:57 PDT 2008
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
More information about the microformats-discuss
mailing list