h-recipe

(Difference between revisions)

Jump to: navigation, search
(Category:Draft Specifications)
(properties intro sentence, move backward compatiblity to its own section)
Line 38: Line 38:
== Properties ==
== Properties ==
-
 
+
h-recipe properties, inside an element with class '''h-recipe''':
-
properties:
+
* '''<code>p-name</code>''' - the name of the recipe
* '''<code>p-name</code>''' - the name of the recipe
* '''<code>p-ingredient</code>''' - describes one or more ingredients used in the recipe.
* '''<code>p-ingredient</code>''' - describes one or more ingredients used in the recipe.
Line 54: Line 53:
* ...
* ...
-
For backward compatibility, microformats 2 parsers {{should}} detect the following root class name and property names. A microformats 2 parser may use existing microformats [[parsers]] to extract these properties. If an "h-recipe" is found, don't look for an "hrecipe" on the same element.
 
-
 
-
compat root class name: <code id="hrecipe">hrecipe</code><br/>
 
-
properties: (parsed as '''p-''' plain text unless otherwise specified)
 
-
* <code>fn</code> - parse as '''<code>p-name</code>'''
 
-
* <code>ingredient</code>
 
-
* <code>yield</code>
 
-
* <code>instructions</code> - parse as '''e-'''
 
-
* <code>duration</code> - parse as '''dt-'''
 
-
* <code>photo</code>  - parse as '''u-'''
 
-
* <code>summary</code>
 
-
* <code>author</code> - including compat root <code>vcard</code> in the absence of <code>h-card</code>
 
-
* <code>nutrition</code>
 
== Status ==
== Status ==
Line 85: Line 71:
* … add any h-recipe examples you find in the wild
* … add any h-recipe examples you find in the wild
 +
 +
== Backward Compatibility ==
 +
=== Publisher Compatibility ===
 +
(stub)
 +
=== Parser Compatibility ===
 +
Microformats parsers {{should}} detect the following root class name and property names. A microformats2 parser may use existing microformats [[parsers]] to extract these properties. If an "h-recipe" is found, don't look for an "hrecipe" on the same element.
 +
 +
compat root class name: <code id="hrecipe">hrecipe</code><br/>
 +
properties: (parsed as '''p-''' plain text unless otherwise specified)
 +
* <code>fn</code> - parse as '''<code>p-name</code>'''
 +
* <code>ingredient</code>
 +
* <code>yield</code>
 +
* <code>instructions</code> - parse as '''e-'''
 +
* <code>duration</code> - parse as '''dt-'''
 +
* <code>photo</code>  - parse as '''u-'''
 +
* <code>summary</code>
 +
* <code>author</code> - including compat root <code>vcard</code> in the absence of <code>h-card</code>
 +
* <code>nutrition</code>
== Background ==
== Background ==

Revision as of 00:28, 15 June 2013

Tantek Çelik (Editor)


h-recipe is a simple, open format for publishing recipes on the web. h-recipe is one of several open microformat draft standards suitable for embedding data in HTML/HTML5.

h-recipe is the microformats2 update to hRecipe.

Contents

Example

Here is a simple minimal recipe example:

<article class="h-recipe">
  <h1 class="p-name">Bagels</h1>
 
  <ul>
    <li class="p-ingredient">Flour</li>
    <li class="p-ingredient">Sugar</li>
    <li class="p-ingredient">Yeast</li>
  </ul>
 
  <p>Takes <time class="dt-duration" datetime="1H">1 hour</time>,
     serves <data class="p-yield" value="4">four people</data>.</p>
 
  <div class="u-instructions">
    <ol>
      <li>Start by mixing all the ingredients together.</li>
    </ol>
  </div>
</article>

Get started

The class h-recipe is a root class name that indicates the presence of an h-recipe.

p-name, e-instructions, p-ingredient and the other property classnames listed below define elements as properties of the h-recipe.

See microformats-2-parsing to learn more about property classnames.

Properties

h-recipe properties, inside an element with class h-recipe:

Experimental properties with wide adoption


Status

h-recipe is a microformats.org draft specification. Public discussion on h-recipe takes place on h-recipe-feedback, the #microformats irc channel on irc.freenode.net, and microformats-new mailing list.

h-recipe is ready to use and implemented in the wild, but for backwards compatibility you should also mark h-recipes up with classic hRecipe classnames.

Property Details

(stub, add any property explanations here)

dt-duration should be marked up using the duration microsyntax defined in HTML5. TODO: add more examples

hRecipe has a number of experimental properties which have real world adoption due to Google recipe search support of hRecipe. These are: summary, author, published and nutrition.

Examples in the Wild

Backward Compatibility

Publisher Compatibility

(stub)

Parser Compatibility

Microformats parsers SHOULD detect the following root class name and property names. A microformats2 parser may use existing microformats parsers to extract these properties. If an "h-recipe" is found, don't look for an "hrecipe" on the same element.

compat root class name: hrecipe
properties: (parsed as p- plain text unless otherwise specified)

Background

h-recipe is based on the existing hRecipe specification.

See Also

Categories

h-recipe was last modified: Wednesday, December 31st, 1969

Views