recipe-brainstorming

From Microformats Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Recipe Brainstorming

Towards a Recipe microformat. Please read the process before editing this page.


format-in-progress - september 2007

This format-in-progress follows the restarting of Recipe development by Frances Berriman on 25th September 2007. Note that this Format-In-Progress section is intended to be edited to reflect the discussion that occurs on the microformats-new list, rather than being a free-form playground for schema. This documentation was produced by Ben Ward and Frances Berriman.

Editor
Frances Berriman (BBC)

Introduction

Recipe is based on examples and fields in existing formats.

The recipe microformat is designed for the mark-up of instructions for creating meals, drinks or food-based items.

Root Class Name

To be decided. Likely ‘hrecipe’.

Property List

Class names author and published are taken from hAtom, photo used from hCard and item from measure.

  • Title. recipe-title. required. text.
  • Summary. recipe-summary. optional. text.
  • Author. author. optional. hcard.
  • Date published. published. optional. datetime-design-pattern.
  • Photo(s). photo. optional. img or url.
  • Ingredient(s). ingredient. 1 or more required.
    • Quantity. quantity. optional. text, optionally measure.
    • Item. item. required. text.
    • Note. note. optional. text.
    • Optionality. optional. optional. text. Its absence should imply that the ingredient is required.
  • Method. method. required. text with optional valid HTML markup.
  • Yield. yield. optional. text.
  • Preparation time. preparation-time. optional. (see ISO-31-1 duration brainstorming)
  • Tags. optional. rel-tag.
  • License. optional. rel-license.

Field Details

Title: The title of the recipe.

  • The element is identified by class name recipe-title.
  • A Recipe MUST have a recipe-title

Summary: The summary provides a short introduction or an accompanying statement about the recipe.

  • The element is identified by class name recipe-summary.
  • A Recipe MAY have a recipe-summary.

Author: Author the person who authored the recipe.

  • The element is identified by class name author.
  • A Recipe MAY include an author.
  • The contents of the element MUST include a valid hCard.

Date published: The date the recipe was published.

  • The element is identified by the class name published.
  • A Recipe MAY include a published date.
  • SHOULD (?) use the datetime-design-pattern to encode the published datetime.

Photo: Accompanying image.

  • The element is identified by the class name photo.
  • A Recipe MAY include one or more photo elements.
  • The element SHOULD use an <img> element.
  • The element MAY use any other element that contains a URL, such as <a> or <object>, but it is not recommended.

Ingredient: Describes an ingredient used in the recipe.

  • The element is identified by the class name ingredient.
  • A Recipe MUST have one or more ingredients.
  • The element MUST include the field item.
  • The element MAY include quantity, note and/or optionality.

Quantity: The quantity of an ingredient needed for the recipe.

  • The element is identified by the class name quantity.
  • An ingredient MAY specify the quantity.

Item: Specifies the name of the ingredient.

  • The element is identified by the class name item.
  • An ingredient MUST specify the item.

Note: A note concerning one of the ingredients.

  • The element is identified by the class name note.
  • An ingredient MAY include a note.

Optionality: States that an ingredient is optional to the recipe.

  • The element is identified by the class name optionality.
  • The optionality of an ingredient MAY be specified.
  • The absence of the element implies that the ingredient is required.

Method: The method of the recipe.

  • The element is identified by the class name method.
  • A Recipe MUST include a method.
  • The field MAY include valid HTML markup (e.g. paragraphs).

Yield: Specifies the quantity produced by the recipe.

  • The element is identified by the class name yield.
  • A Recipe MAY include a yield.


format-in-progress - #2 - october 2008

This second Format-In-Progress reflects the discussions following the first one from september 2007 (see above). It's not an entirely new format but rather an evolution and about 95% the same as the first one. Most important changes are the adition of a nutrition element , a preparation-time-note element and the optionality of method. To improve readability also parts that haven't changed are repeated, while changes are marked with <#2 and commented. Please note again that Format-In-Progress sections are intended to be edited to reflect the discussion that occurs on the microformats-new list, rather than being a free-form playground for schema. This Format-In-Progress was produced by ThomasLoertsch 15:29, 15. Oct 2008 (CET)

Introduction

Recipe is based on examples and fields in existing formats.

The recipe microformat is designed for the mark-up of instructions for creating meals, drinks or food-based items.

Root Class Name

To be decided. Likely ‘hrecipe’.

Property List

Class names author and photo are taken from hCard, published used from hAtom and item from measure.

  • Title. recipe-title. required. text.
  • Summary. recipe-summary. optional. text.
  • Author. author. optional. hcard.
  • Date published. published. optional. datetime-design-pattern.
  • Photo(s). photo. optional. [[hcard]. img or url.
  • Ingredient(s). ingredient. 1 or more required.
    • Item. item. optional. text. measure.
    • Quantity. quantity. optional. text, optionally measure.
    • Note. note. optional. text.
    • <#2 deleted Optionality
  • Method. method. optional. text with optional valid HTML markup. <#2 changed to optional
  • Yield. yield. optional. text.
  • Preparation time. preparation-time. 1 or more, optional. (see ISO-31-1 duration brainstorming) <#2 changed to optionally multiple instances
    • Preparation time note. preparation-time-note. optional. text <#2 added
  • Tags. optional. rel-tag.
  • Nutritionnutrition. optional. measure <#2 added, see Field Details below for a longer version
  • License. optional. rel-license.

Field Details

Title: The title of the recipe.

  • The element is identified by class name recipe-title.
  • A Recipe MUST have a recipe-title

Summary: The summary provides a short introduction or an accompanying statement about the recipe.

  • The element is identified by class name recipe-summary.
  • A Recipe MAY have a recipe-summary.

Author: Author the person who authored the recipe.

  • The element is identified by class name author.
  • A Recipe MAY include an author.
  • The contents of the element MUST include a valid hCard.

Date published: The date the recipe was published.

  • The element is identified by the class name published.
  • A Recipe MAY include a published date.
  • SHOULD (?) use the datetime-design-pattern to encode the published datetime.

Photo: Accompanying image.

  • The element is identified by the class name photo.
  • A Recipe MAY include one or more photo elements.
  • The element SHOULD use an <img> element.
  • The element MAY use any other element that contains a URL, such as <a> or <object>, but it is not recommended.

Ingredient: Describes an ingredient used in the recipe.

  • The element is identified by the class name ingredient.
  • A Recipe MUST have one or more ingredients.
  • The element MUST include the field item.
  • The element MAY include quantity and/or note.

Quantity: The quantity of an ingredient needed for the recipe.

  • The element is identified by the class name quantity.
  • An ingredient MAY specify the quantity.

Item: Specifies the name of the ingredient.

  • The element is identified by the class name item.
  • An ingredient MUST specify the item.

Note: A note concerning one of the ingredients.

  • The element is identified by the class name note.
  • An ingredient MAY include a note.
  • <#2 Optionality has been deleted since it's rarely needed and can be stated within a note

Method: The method of the recipe.

  • The element is identified by the class name method.
  • A Recipe MAY include a method.
  • The field MAY include valid HTML markup (e.g. paragraphs).
  • <#2 method is now optional since there are recipes like salads or shakes that don't need a method

Yield: Specifies the quantity produced by the recipe.

  • The element is identified by the class name yield.
  • A Recipe MAY include a yield.

Preparation Time: The time it takes to prepare the meal described by the recipe.

  • The element is identified by the class name preparation-time.
  • A Recipe MAY include one or more preparation-times.
  • <#2 Since some recipes need not only time for preparation, but also considerable time for e.g. boiling, waiting for the dough to rise etc, this element may be used multiple times.

Preparation Time Note: <#2 added. Specifies the purpose of a Preparation Time .

  • The element is identified by the class name preparation-time-note.
  • A Preparation Time MAY include a preparation-time-note.
  • An optional note may be added to each of multiple intervals to specify their respective purpose.

Nutrition: <#2 added to optionally provide nutritional information.

  • The element is identified by class name nutrition.
  • A Recipe MAY include a nutrition element.
  • This simple version would just add Joules since this is the most used and asked for information.
  • A more elaborate version would add information for fat, proteins, carbohydrates and dietary fiber - but this may already be out of the 80/20 range. Of course a lot more nutritional values would be available but these seem definitely outside 80/20.
    • Nutritionnutrition. optional
      • Energy. energy. optional. Joule measure
      • Fat. fat. optional. gram measure
      • Protein. protein. optional. gram measure
      • Carbohydrates. carbohydrates. optional. gram measure
      • Dietary fiber. dietary fiber. optional. gram measure

Example

<div class="hrecipe">
	<p class="recipe-title">Pommes Frites</p>
	<p class="recipe-summary">Pommes frites come from the outer space. They are served hot.<br />This recipe is only an example. Don't try this at home!</p>
	<p class="vcard"><span class="fn">Thomas Loertsch</span></p>
	<p>Published <abbr class="published" title="2008-10-14T10:05:37-01:00">14. Oct 2008</abbr></p>
	<img src="/img/pommes.png" class="photo" width="100" height="100" alt="Pommes Frites"/>
	<p class="ingredient">
		<span class="quantity hmeasure">
			<span class="num">500</span> 
			<span class="unit">gramme</span>
		</span>
		<span class="item">potatoes</span>,
		<span class="note">hard cooking</span>.
	</p>
	<ul class="method">
	    <li>First wash the potatoes.</li>
	    <li>Then slice and dice them and put them in boiling fat.</li>
	    <li>After a few minutes take them out again.</li>
	</ul>
	<p>Enough for <span class="yield">12</span> children.</p>
	<p class="preparation-time hmeasure">Preparation time is approximately <span class="num">90</span> <span class="unit">minutes</span>.</p>
	<p class="preparation-time hmeasure">Add <span class="num">5</span> <span class="unit">minutes</span> for <span class="preparation-time-note">preparing the Ketchup</span>.</p>
	<p>This recipe is <a href="http://www.eut.de/tags/difficulty/easy" rel="tag">easy</a> and <a href="http://www.eut.de/tags/tastyness/delicious" rel="tag">delicious</a>.</p>
	<p class="nutrition hmeasure">Pommes Frites have more than <span class="num">1000</span> <span class="unit">Joule</span></p>
	<p>This recipe is licensed under <a href="http://creativecommons.org/licenses/by/2.0/" rel="license">CC by 2.0</a>.</p>
</div>

brainstorming

RecipeML-based Brainstorm

Excerpted from Conor Bandon's Blog entry and derived from The RecipeML Spec:

  • Recipe_Title
  • Summary Description (one liner)
  • Measurement System (U.S., Imperial etc)
  • Ingredients (each one a separate "item" rather than block text with count/amount/range/unit broken out too)
    • Some (e.g. meats, vegetables) could optionally be marked up with (elements of) the proposed species microformat. Andy Mabbett 06:41, 16 Nov 2006 (PST)
    • Ingredient importance (e.g. Main, Required, Optional) should be listed as an attribute of each entry. α
    • Units need separate microformat: see measure
    • Ingredient Preparation: such as diced, chopped, sliced, grated, minced, etc. Steve Lewis 18:55, 11 Feb 2007 (PST)
  • Preparation Time (overall time)
  • Yield Quantity and Unit (4 pancakes or 5 servings)
  • Background Information - Optional section to encapsulate information that is useful but not necessarily required for a successful recipe. α
    • Author (Person) (hcard?)
    • Submitter (Person) (hcard?)
    • Source (Book Title etc)
    • Date (Of Creation or Publication)
    • Rights (Copyright or other)
    • Meal Category (Starter, entree, dessert )
    • Cuisine Category (Italian etc)
  • Instructions (text, but can contain:)
    • Steps (optional)
      • Should be an ordered list Andy Mabbett 14:46, 16 Nov 2006 (PST)
      • Another vote for an ordered list, perhaps in the XOXO format. α
      • Many recipes associate ingredients with specific steps of a multi-step method; if methods are broken out into steps, then the format should support this association whether the complete ingredient list is up front or the ingredient list is itself broken out per step. Ben Curtis
  • Photo (optional) Cameron Perry
    • Could be one per dish, or one for each (or for some of the) step(s). Andy Mabbett

Cookcamp brainstorming

At CookCamp in February 2007, Tantek moderated a fairly free form discussion of how to publish/share recipes. Here is a photo of the whiteboard: 422072573_9956d93f61.jpg

To Do: OCR this and enter rough notes here...

Additional Suggestions

  • Steps - As cited above but to include estimated time per step. Include the type of step (prep, preheat, cook, bake, mix, saute, etc) as well as the ingredients involved. This would be very useful when trying to time a meal so all the food appears together.
    • I think this is being to specific. Are there any real world examples where this would be useful? --Yde 08:41, 30 May 2008 (PDT)
  • Difficulty/Notes - Perhaps incorporation of hReview to describe difficulty (using rating) and general comments (review), as an optional field. Frances Berriman
    • -1. Too diverse in the wild, better handled bytags (at least in the first version). same for suitablility.
  • Suitability (e.g. vegetarian, vegan, wheat-free, etc.). Possibly rel-tag. Andy Mabbett 14:57, 16 Nov 2006 (PST)
  • Ingredient Grouping - In baking you need to differentiate wet from dry ingredients. See also an example recipe from extratasty.com for useful grouping in cocktail mixing. Steve Lewis 19:10, 11 Feb 2007
    • Maybe this ingredient grouping can be used to express some alternative ingredients, like "mayonnaise or cream cheese". Estêvão Samuel Procópio 15:33, 16 Dez 2007 (PDT)
    • This could be solved by using a xoxo list and ignoring list items that don't include a class="name". Example:

<ul class="ingredients"> <li>Booze <ul> <li>1 part <span class="name">Rum</span></li> </ul> </li> <li>Mixer <li>1 part <span class="name">Cola</span></li> <li>1 part <span class="name">Lime juice</span></li> </li> </ul> --Yde 13:09, 18 Apr 2008 (PDT)

    • We can't have a dependency on XOXO or any list mark-up for ingredients. That's too restrictive on publishing patterns, preventing patterns like:

<p class="method">Take <span class="ingredient"><span class="quantity">a handful</span>

of spinach</span> and fry it</p> --BenWard 13:20, 18 Apr 2008 (PDT)

    • You're right. I think grouping would introduce too many new elements (class="group", class="group-title") considering how relatively uncommon this is. --Yde 13:51, 23 Apr 2008 (PDT)
  • Method > Steps - or Method-Step[] as a child of Method. Imply ordered steps from an HTML list or explicitly mark-up ordered steps respectively.
    • -1. Outside 80/20. POSH is good enough for this purpose. --ThomasLoertsch 15:04, 01 Oct 2008 (CET)
  • Number of dishes or similar - often it's mentioned how many dishes (or breads in baking, etc) the ingredients are for. WilleRaab 16:57, 20 Jul 2007 (PDT)
  • Suitable for occasions - what occasions are the dish suitable for? WilleRaab 16:57, 20 Jul 2007 (PDT)
  • Category - many sites categorize their recipes. WilleRaab 16:57, 20 Jul 2007 (PDT)
    • Tags could be used for both suitability and category.
  • Under what terms is the recipe licensed? Microformat: rel="license". Often a page is in the creative commons but the page author has taken some text from a copyrighted page and in theory re-published the work in violation to the terms of use, adding a rel="license" to each recipe on the page? Lee Jordan 20:55, 04 Feb 2008 (GMT)
  • Single foodstuffs - If "method" is made optional, this could be used for marking up individual foodstuffs in prose. for example, "I like to eat cheese for supper." would become:
I like to eat <span class="hRecipe"><span class="ingredient">cheese</span></span> for supper.

or simply (if the proposed "sub-microformat-pattern" is adopted):

I like to eat <span class="hRecipe-ingredient">cheese</span> for supper.
Andy Mabbett 08:16, 5 Jan 2008 (PST)
    • But that's not really a recipe, is it? And what would the purpose of knowing that cheese is an ingredient be? --Yde 12:46, 18 Apr 2008 (PDT)
    • -1. Makes no sense to me either --ThomasLoertsch 15:29, 01 Oct 2008 (CET)
  • Menus - With the addition of a "price" field, and perhaps one or two others, and again making "method" optional, this microformat can also be used for menus. See menu examples. Andy Mabbett 02:39, 19 Feb 2008 (PST)
    • I would consider this out of scope (which is to produce an as-simple-as-possible microformat "for the mark-up of instructions for creating meals, drinks or food-based items" - introduction) --Yde 13:39, 23 Apr 2008 (PDT)

Calories

per serving. May be part of the measure microformat in future.

  • +1. Nutritional information is quite important for a lot of people and is inside the 80/20. It should be included as an optional element. The problems are: which nutritional information exactly? A common denominator is calories, proteins, carbohydrates and fat. That's also what european law demands as information on packaged food. Most sites that I visited only list calories as nutritional information (if any). Since Calories are a somehow superordinate concept for proteins, carbohydrates and fat that's fine. Allrecipes.com is quite extreme with a huge list of nutritional information - clearly outside 80/20 IMHO. Another problem: although Calories are the most popular term, the measure is deprecated in favor of Joule. hMeasure too uses Joule. I'd therefor propose to add the optional element nutrition and subelements calories("mandatory") in Joule,fat("optional"), protein("optional"), carbohydrates("optional"), and dietary fiber("optional"), those all in grams. --ThomasLoertsch 15:16, 01 Oct 2008 (CET), modified 09.Oct 2008 and 13.Oct 2008
    • +1 for a nutrition element. However, I would like to change the subelement calories to energy, as that would allow using either calories or joules (using hMeausere) and it feels weird to state joule in an element called calories. --Yde 05:57, 11 Oct 2008 (PDT)
    • I felt the same and energy is a good idea. However I think we should stay with Joules, since hMeasure doesn't include Calories and we don't want to get things too complicated.
      • hMeasure allows any units to be used. The unit property is defined as an opaque string. The draft spec does allow parsers to delve into this otherwise opaque string and assign meaning to it, and strongly suggests that any parsers which do this support all SI units and prefixes. However, it does not prevent authors from using non-SI units, such as calories. TobyInk
      • You're right. Still, wouldn't it make more sense to go for the standardized Joule instead of the deprecated and non-standardized Calories?
        • I think a lot of people are using calories instead of joule (or both), so IMO it would be too restrictive to only allow joule. --Yde 02:50, 18 Oct 2008 (PDT)
    • But do we really decide for the multi-element proposal outlined above? Or should we rather go for a simple and single nutrition element, optional, without subelements (and with hMeasure Joule)? I'm still undecided myself. ThomasLoertsch 12:02, 13.Oct 2008 (CET)

Note

The 'note' property is only useful in some rare cases and might not fit the 80-20 rule.

  • We might want to start as simple as possible and leave this out for a future revision.
  • People often put some of the very basic preparation steps into the ingredients list. For example, ingredients lists sometimes read like "one onion, finely chopped".
  • +1. note should stay as an optional value. There are so many ways to define ingredients that it seems useful enough to fit into the 80/20. --ThomasLoertsch 15:26, 01 Oct 2008 (CET)

Optional

Instead of note I'd rather remove the optional property. Information about the optionality of an ingredient can easily be added in the note field, e.g. together with suggestions for a possible replacement. --ThomasLoertsch 12:59, 13.Oct 2008 (CET)

Method

For informally or concisely written recipes, the method is often left out. Could we either make this optional, or have an optimisation such that if the method is absent, the entire text of the recipe is taken to be the method. TobyInk 02:53, 15 Jul 2008 (PDT)

  • e.g. salad, sandwich and smoothie recipes don't often require a method to be useful.
  • +1 for making it optional. Although most recipes rely heavily on a method there are indeed those where it isn't necessary. If 80/20 does mean that easy or simple usecases should be facilitated it would be in line with the principal to make the method optional. And it wouldn't hurt anybody either. --ThomasLoertsch 15:04, 01 Oct 2008 (CET)
  • I don't know... Making the method optional would make "I like to eat cheese for supper" a technically valid recipe, but it provides no value as a recipe. In other words, I am concerned that this will lead to people using the format for things it was not intented for. I don't know if this will happen, but we need to take it into consideration. --Yde 06:17, 11 Oct 2008 (PDT)
  • I think there's no technical way to prevent misuse (and no other way either ;-). --ThomasLoertsch 12:52, 13.Oct 2008 (CET)

Preparation Time

Make preparation-time plural and add an optional preparation-time-note element inline to preparation time

  • preparation-time (optional, plural)
    • preparation-time-note (optional, singular)

There are often times additional to the main preparation time i.e. the time the dough needs to rise. When scanning a recipe for practicality - i.e. your guest are coming in 4 hours - this is a very important information. Allowing preparation-time to be used more than once per recipe and adding an optional note element would allow great flexibility in stating such details while staying simple. It could also be used to give times for different parts of a recipe like cake and topping or to differentiate times for preparation, waiting and cooking. --ThomasLoertsch 15:05, 01 Oct 2008 (CET)

  • That's a good point. But how do we semantically connect the preparation time and a specific part of the recipe? --Yde 06:25, 11 Oct 2008 (PDT)
  • In the absence of sections for ingredients or method steps I see no way to connect the preparation time and a specific part of the recipe in a standardized manner. But the same applies to ingredients and method steps. I guess a solution would need some quite involved sectioning constructs. In my feeling this is not such a big problem that it justifies further constructs. ThomasLoertsch 12:25, 13 Oct 2008 (CET)

Quantity

There are a lot of units typically used in recipes that do not make much sense in most other cases and therefor most likely will never make it into a 80/20-aware measure-microformat. This is a deliberatly short list:

  • cup
  • leave
  • pinch
  • tablespoonful
  • teaspoonful
  • lacing
  • tie (??? my english is really leaving me here, hope you get the idea)

note can be used to indicate more subtle differentiation (like a "big spoonful", "some leaves" etc). I think this list is both usefully short and complete. The following measures:

  • weight (gram)
  • volume (litre)
  • length (metre)

can be taken from the measure microformat. I guess measure is already stable enough that it's save to use these terms "experimentally". The measure-element should be optional. That way nobody is forced to select a value from it - it's just a help to facilitate interoperability. --ThomasLoertsch 15:45, 01 Oct 2008 (CET)

Proposed Optimisations

Item

Can we have this optimisation?... if no "item" is found, the entire ingredient is taken to be the item. TobyInk

Example:

<span class="ingredient">salt</span>

is a shorthand for:

<span class="ingredient"><span class="item">salt</span></span>
  • +1. That and the Proposed Ingredient List Optimisation seem to be very pragmatic proposals. --Yde 14:40, 14 Jul 2008 (PDT)
  • -1. I'm not convinced that it's wise to introduce variations in the syntax for the singlemost important element (beside the title). Also the case seems very rare to me. Can you give some examples? --ThomasLoertsch 15:07, 01 Oct 2008 (CET)

Ingredient List

TobyInk 03:42, 23 Mar 2008 (PDT):

If class="ingredients" (note: plural) is found on an element, class="ingredient" (note: singular) is automatically implied on all its children.

<ul class="ingredients">
<li><span class="quantity">3</span> <span class="item">eggs</span></li>
<li><span class="quantity">6 oz</span> <span class="item">self-raising flour</span></li>
<li><span class="quantity">6 oz</span> <span class="item">caster sugar</span></li>
<li><span class="quantity">6 oz</span> <span class="item">butter</span></li>
<li><span class="quantity">1 tsp</span> <span class="item">vanilla essence</span></li>
</ul>

is a shorthand for:

<ul class="ingredients">
<li class="ingredient"><span class="quantity">3</span> <span class="item">eggs</span></li>
<li class="ingredient"><span class="quantity">6 oz</span> <span class="item">self-raising flour</span></li>
<li class="ingredient"><span class="quantity">6 oz</span> <span class="item">caster sugar</span></li>
<li class="ingredient"><span class="quantity">6 oz</span> <span class="item">butter</span></li>
<li class="ingredient"><span class="quantity">1 tsp</span> <span class="item">vanilla essence</span></li>
</ul>
  • I agree. This would save a lot of space, especially combined with the proposed hmeasure minimisation technique. --Yde 12:57, 18 Apr 2008 (PDT)
  • Do we have ingredients (plural) as an element? Doesn't that open a whole can of list-issues? --ThomasLoertsch 15:37, 01 Oct 2008 (CET)

Ingredient Item/Quantity

TobyInk 03:42, 23 Mar 2008 (PDT):

This idea's a bit more "out there" and probably needs a bit more work.

<li class="ingredient">3  eggs</li>

(note the double-space between '3' and 'eggs') is treated as a shorthand for:

<li class="ingredient"><span class="quantity">3</span> <span class="item">eggs</span></li>

This is similar to N-optimisation in hCard, but uses a double space instead of a single space because the components (quantity, item) may themselves each contain spaces. With both of these optimisations in place, the sponge cake ingredient list can be written as concisely as:

<ul class="ingredients">
<li>3  eggs</li>
<li>6 oz  self-raising flour</li>
<li>6 oz  caster sugar</li>
<li>6 oz  butter</li>
<li>1 tsp  vanilla essence</li>
</ul>

Which (apart from the double spaces) is pretty close to how many people publish ingredients lists already. (Certainly close to how I do!)

Alternative Ingredient Item/Quantity Optimisation

TobyInk 02:02, 24 Mar 2008 (PDT): Perhaps a better solution than the double spacing...

As above, but:

<ul class="ingredients">
<li><var>3</var> eggs</li>
<li><var>6 oz</var> self-raising flour</li>
<li><var>6 oz</var> caster sugar</li>
<li><var>6 oz</var> butter</li>
<li><var>1 tsp</var> vanilla essence</li>
</ul>

Or is this stretching the meaning of <var> too much?

Problems with programatically marking up ingredients

While I understand the need for a item element within an ingredient, in practice this may be difficult to implement. The quantity element suffers from the same problem, but it's optional, unlike item.

The problem occurs when marking up existing recipes for display. A list of ingredients pulled from a database is trivial to mark up with ingredient but it's nearly impossible to add the required item with a high degree of accuracy. Doing so would require being able to parse each ingredient and identify and separate the quantities and items, which is only really possible if you know in advance every form the quantities will take so you can accurately pattern-match them.

For a real-world example, I'm currently building a site for a good-sized (9,000+) recipe collection. These recipes come from a number of sources and contain many different units of measure. While I can match for things like "oz", "cup", etc, and assume that what follows is the item, this is error prone and doesn't take into account things like "pinch", "dash", and the nearly endless list of other possible terms I may encounter.

I'd like to suggest that item be made optional, as the other child elements of ingredient already are. People coding recipes by hand or who are otherwise able to separate these things may use them, but those of us who are unable to do this can omit them while still outputting valid recipe microformat.

Kenn Wilson 11:29, 19 Oct 2008 (PDT)

issues

Issues have been moved to a seperate recipe-issues page.

implementations

Cognition

As of September 2008, Cognition has experimental support for this format. (Details of support.) Recipes may be exported in RecipeBook XML format or RDF.

examples in the wild

Wild Mushroom, Pancetta & Truffle Risotto by Toby Inkster

related pages