<entry-title>Microformats in HTML5</entry-title>
This page is to document future use of microformats in HTML5. None of the items documented are supported now, and may change upon proper development within the microformats community, or changes in the HTML 5 specification. This page is to track HTML5 enabled enhancements to microformats, and issues that HTML5 raises. It may be used to track issues which we need to push back into the HTML 5 development process.
If there are things that microformats would like to mark up that aren't handled by HTML5 explicitly, please let the WHATWG know, so we can improve HTML5. This is how the
time element came to be, for instance.
- 1 New features in HTML5
- 2 Additions beyond HTML5
- 3 Current microformat compatibility
- 4 Requests
- 5 Issues
- 6 see also
New features in HTML5
time element for representing date times. In HTML5, the machine form of datetimes can be represented natively. In some cases it may be possible to replace the date-time design pattern with native HTML5.
timetakes an optional
pubdateattribute, to indicate the publication date of an
article. Synonymous with hAtom 0.1
published, may imply hAtom 0.1
updated, may imply hReview 0.4 (in progress)
dtreviewed, may imply hListing draft
Note that there are documented limitations in the time element. Please add additional opinions and use cases to that wiki page so that we can help improve the time element.
- Recommendation: Use the Value Class Pattern, in particular preferably date-time-separation for accessibly marking up dates and times while following the DRY principles as much as possible.
article element for major, independent compositions of content within a page. Perhaps synonymous with hAtom 0.1
hentry. Could be parsed as
hentry within explicit
data- naming convention for tag attributes. the draft specification states that any attribute that starts with "data-" will be treated as a storage area for private data.
- Note that the data-* stuff is explicitly not for microformats. Those attributes are defined in such a way that browsers will never do anything special with them, ever. They are intended for script authors to have a space in which they can play without ever clashing with anything the browser does. There may be some cases of private poshformats that are never intended for interchange that may be used in data-* attributes.
Additions beyond HTML5
microdata is an extension to HTML5 that provides a set of attributes and associated DOM APIs for semantically marking up and extracting data from existing content in web pages, similar to microformats but with new attributes.
itempropattribute is a more specific version of
class, for field names
subjectattribute allows semantically linking within the page. Conceptually similar to the include-pattern.
itemrefattribute allows including properties elsewhere on the page that are not descendants of
itemscope. Takes space-separated ids (for example
itemref="address phone"would include the elements with
id="phone"). Conceptually similar to the include-pattern.
contentattribute on the
metaelement can be used to include invisible data that is not part of the content. As current browsers move
<head>, make sure to include via
itemref. Conceptually similar to the 'value-title' feature of the Value Class Pattern.
itemscopeattribute identifies blocks to be marked as structured data. Conceptually similar to the mfo-examples brainstorming.
itemtypeattribute to specify the type for an item (for example:
microdata vCard vocabulary
Formerly documented as a separate specification at http://dev.w3.org/html5/mdvcard/, the microdata vCard vocabulary is currently available as part of WHATWG additions to HTML5.
- Recommendation: use hCard 1.0 directly instead, taking into account:
hCard 1.0.1 (under development) is incorporating these errata.
- Avoid the "microdata vCard vocabulary" as in many ways it is an out-of-date fork/snapshot of hCard, even though portions of it appear to based directly on the vCard RFC. as well.
- Avoid Google’s Rich Snippets vocabularies (Person and Organization), which are also forks of hCard/vCard, and are only implemented by Google currently.
microdata vEvent vocabulary
Formerly documented as a separate specification at http://dev.w3.org/html5/mdvevent/, the microdata vEvent vocabulary is currently available as part of WHATWG additions to HTML5.
- Recommendation: use hCalendar 1.0 directly instead, taking into account:
hCalendar 1.0.1 (under development) is incorporating these errata.
- Avoid the "microdata vEvent vocabulary" as in many ways it is an out-of-date fork/snapshot of hCalendar's vevent root class name and applicable properties, though portions of it even though portions of it appear to based directly on the iCalendar RFC.
- Avoid Google’s Rich Snippets vocabulary (Event), which is also a fork of hCalendar/iCalendar, and are only implemented by Google currently.
microdata Licensing Works vocabulary
Formerly documented as a separate specification at http://dev.w3.org/html5/mdwork/, the microdata Licensing Works vocabulary is currently available as part of WHATWG additions to HTML5.
The Licensing microformat work provides a potential microformat alternative to the microdata Licensing Works vocabulary.
Please see: Licensing Brainstorming and provide feedback.
Current microformat compatibility
There seems to be no issue with current implementation of the following microformats in HTML 5:
- "how to use with HTML5" sections that include (a) microformats examples that use Microformats in HTML5, and (b) microformats parsing details that specify what to do (if anything special is required) with HTML5 elements (e.g. how to parse the
timeelement for dates and times for microformats). See (and add to if necessary) :
- hCard brainstorming - how to use with HTML5
- hCalendar brainstorming - how to use with HTML5 e.g. hCalendar with the
- citation brainstorming - how to use with HTML5
- if nothing special is required for HTML5, then after performing the analysis, that should be noted as well, for the purpose of clarity.
revattribute has been removed. In HTML5,
revare no-longer paired, and the
relattribute nolonger describes the direction of a relationship. Microformats which use
revwill need to use
- Or something like data-rev="vote-for"
- As above,
data-attributes are for application-context functionality, not shared vocabularies. Further, the HTML5 specification makes
relthe correct attribute to use, regardless of direction, through the changed specification. --BenWard 17:53, 12 May 2009 (UTC)
- As above,
- Or something like data-rev="vote-for"
profileattribute has been removed. In HTML, the
profileattribute from the
headhas been removed, with no direct replacement. This causes issues for GRDDL support. It's been suggested that profile URLs be represented in
linkelements instead, or even as a custom HTTP header. See grddl and profile-uris
classdata. the new attribute itemprop is designed to hold some meaningful data about an element, but class already exists to hold this data. Unsure of reasons why itemprop required?
- This is because microdata is designed to be generically parsable, even when the parser does not understand the vocabulary. As such, property names have to be on an explicit attribute, not shared with other, non-data classnames. --BenWard 21:12, 4 September 2009 (UTC)
- The recommended removal of the colon in timezone doesn’t validate The relevant uF wiki text is “However the colons ":" separating the hours and minutes of any timezone offset are optional and discouraged in order to make it less likely that a timezone offset will be confused for a time.” ref: HTML5 time microsyntax for <time> --Oli 14:40, 14 February 2010 (+9)