h-card: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(update to)
(properties intro sentence, move backward compatiblity to its own section)
Line 38: Line 38:


== Properties ==
== Properties ==
h-card properties (inside class <code>'''h-card'''</code>)
h-card properties, inside an element with class '''h-card''':
 
* '''<code>p-name</code>''' - The full/formatted name of the person or organisation
* '''<code>p-name</code>''' - The full/formatted name of the person or organisation
* '''<code>p-honorific-prefix</code>''' - e.g. Mrs., Mr. or Dr.
* '''<code>p-honorific-prefix</code>''' - e.g. Mrs., Mr. or Dr.
Line 79: Line 78:
* '''<code>dt-anniversary</code>'''
* '''<code>dt-anniversary</code>'''


== Status ==
'''h-card''' is a microformats.org draft specification. Public discussion on h-card takes place on [[h-card-feedback]], the #microformats [[irc]] channel on irc.freenode.net, and [http://microformats.org/discuss/mail/microformats-new/ microformats-new mailing list].
h-card is ready to use and implemented in the wild, but for backwards compatibility you should also mark h-cards up as classic [[hCard]]s.
== Property Details ==
(stub, to be expanded)
<code>p-adr</code> and its associated postal address properties can optionally use [[h-adr]], for example:
<source lang=html4strict>
<p class="p-adr h-adr">
  <span class="p-street-address">17 Austerstræti</span>
  <span class="p-locality">Reykjavík</span>
  <span class="p-country-name">Iceland</span>
</p>
</source>
Reserved properties (not used much, if at all, in practice):
* '''<code>p-organization-name</code>'''
* '''<code>p-organization-unit</code>'''
* '''<code>p-tz</code>'''
* '''<code>dt-rev</code>'''
Note: use of 'value' within 'tel' should be automatically handled by the support of the [[value-class-pattern]]. And for now, the 'type' subproperty of 'tel' is dropped/ignored. If there is demonstrable documented need for additional tel types (e.g. fax), we can introduce new flat properties as needed (e.g. p-tel-fax).
== Examples in the wild ==
Real world in the wild examples:
* ... add uses of h-card you see in the wild here.
* [http://www.w3.org/conf/ W3Conf 2013] uses h-card for all the event speakers and notable attendees. The h-cards make particularly good use of implied name, url, and photo properties.
* [http://wordpress.org/extend/themes/sempress SemPress] is a WordPress theme that supports h-card, h-feed/h-entry and h-as-*
* [http://the-pastry-box-project.net/ The Pastry Box Project] use h-card markup on their homepage and individual thoughts pages
* Tom Morris uses h-card and [[XFN]] to markup [http://tommorris.org/pages/blogroll his blogroll].
* Aaron Parecki uses h-card to markup both authorship and references to people in his notes permalinks, e.g. [http://aaronparecki.com/2012/230/reply/1 2012/230/reply/1].
* [http://tantek.com/ Tantek Çelik] uses h-card  on his home page as well as within [[h-entry]]s on permalink pages to indicate authorship.
* [http://waterpigs.co.uk/ Barnaby Walters] uses h-card on his home page, as well as within h-entries for notes and articles, both to indicate authorship and also when mentioning people within the body of the notes.
* [http://tantek.com/presentations/2012/06/microformats microformats.org at 7 years] presentation with and h-card markup for people and organizations.
* [http://tantek.com/presentations/2012/06/pdf2012-indieweb.html Rise of the Indie Web hCards] (from Personal Democracy Forum 2012 #pdf12 #pdf2012) has [[microformats-2]] h-card markup
* WebMaker by Mozilla has [[microformats-2]] h-card on event search (e.g. [https://webmaker.org/en-US/events/near/?lat=45.5234515&lng=-122.6762071 search near Portland Oregon]) and event pages (e.g. [https://webmaker.org/en-US/events/192f56eb9/ IndieWebCamp 2012]).[https://twitter.com/microformats/status/212207925643587585]
* WebFWD by Mozilla has [[microformats-2]] h-card markup on [https://webfwd.org/about/experts/ experts] and [https://webfwd.org/about/team/ team] pages
* [http://indiewebcamp.com IndieWebCamp] has [[microformats-2]] h-event markup with nested h-cards for the organizers and the location.
* [https://wiki.mozilla.org/Events Mozilla Events] page has [[microformats-2]] h-event markup with attendees marked up with h-card.
== Backward Compatibility ==
=== Publisher Compatibility ===
For backward compatibility, you may wish to use classic [[hCard]] classnames in addition to the more future-proof h-card properties, for example:
For backward compatibility, you may wish to use classic [[hCard]] classnames in addition to the more future-proof h-card properties, for example:


Line 85: Line 131:
</source>
</source>


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-card" is found, don't look for a "vcard" on the same element.
=== 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-card" is found, don't look for a "vcard" on the same element.
TODO: move this to a “parsing” or “back compatibility” section? --[[User:Barnabywalters|bw]] 21:01, 13 June 2013 (UTC)


Compat. root class name: <code id="vcard">vcard</code><br/>
Compat. root class name: <code id="vcard">vcard</code><br/>
Line 129: Line 174:
* <code>rev</code> - parse as '''dt-'''
* <code>rev</code> - parse as '''dt-'''


== Status ==
'''h-card''' is a microformats.org draft specification. Public discussion on h-card takes place on [[h-card-feedback]], the #microformats [[irc]] channel on irc.freenode.net, and [http://microformats.org/discuss/mail/microformats-new/ microformats-new mailing list].
h-card is ready to use and implemented in the wild, but for backwards compatibility you should also mark h-cards up as classic [[hCard]]s.
== Property Details ==
(stub, to be expanded)
<code>p-adr</code> and its associated postal address properties can optionally use [[h-adr]], for example:
<source lang=html4strict>
<p class="p-adr h-adr">
  <span class="p-street-address">17 Austerstræti</span>
  <span class="p-locality">Reykjavík</span>
  <span class="p-country-name">Iceland</span>
</p>
</source>
Reserved properties (not used much, if at all, in practice):
* '''<code>p-organization-name</code>'''
* '''<code>p-organization-unit</code>'''
* '''<code>p-tz</code>'''
* '''<code>dt-rev</code>'''
Note: use of 'value' within 'tel' should be automatically handled by the support of the [[value-class-pattern]]. And for now, the 'type' subproperty of 'tel' is dropped/ignored. If there is demonstrable documented need for additional tel types (e.g. fax), we can introduce new flat properties as needed (e.g. p-tel-fax).
== Examples in the wild ==
Real world in the wild examples:
* ... add uses of h-card you see in the wild here.
* [http://www.w3.org/conf/ W3Conf 2013] uses h-card for all the event speakers and notable attendees. The h-cards make particularly good use of implied name, url, and photo properties.
* [http://wordpress.org/extend/themes/sempress SemPress] is a WordPress theme that supports h-card, h-feed/h-entry and h-as-*
* [http://the-pastry-box-project.net/ The Pastry Box Project] use h-card markup on their homepage and individual thoughts pages
* Tom Morris uses h-card and [[XFN]] to markup [http://tommorris.org/pages/blogroll his blogroll].
* Aaron Parecki uses h-card to markup both authorship and references to people in his notes permalinks, e.g. [http://aaronparecki.com/2012/230/reply/1 2012/230/reply/1].
* [http://tantek.com/ Tantek Çelik] uses h-card  on his home page as well as within [[h-entry]]s on permalink pages to indicate authorship.
* [http://waterpigs.co.uk/ Barnaby Walters] uses h-card on his home page, as well as within h-entries for notes and articles, both to indicate authorship and also when mentioning people within the body of the notes.
* [http://tantek.com/presentations/2012/06/microformats microformats.org at 7 years] presentation with and h-card markup for people and organizations.
* [http://tantek.com/presentations/2012/06/pdf2012-indieweb.html Rise of the Indie Web hCards] (from Personal Democracy Forum 2012 #pdf12 #pdf2012) has [[microformats-2]] h-card markup
* WebMaker by Mozilla has [[microformats-2]] h-card on event search (e.g. [https://webmaker.org/en-US/events/near/?lat=45.5234515&lng=-122.6762071 search near Portland Oregon]) and event pages (e.g. [https://webmaker.org/en-US/events/192f56eb9/ IndieWebCamp 2012]).[https://twitter.com/microformats/status/212207925643587585]
* WebFWD by Mozilla has [[microformats-2]] h-card markup on [https://webfwd.org/about/experts/ experts] and [https://webfwd.org/about/team/ team] pages
* [http://indiewebcamp.com IndieWebCamp] has [[microformats-2]] h-event markup with nested h-cards for the organizers and the location.
* [https://wiki.mozilla.org/Events Mozilla Events] page has [[microformats-2]] h-event markup with attendees marked up with h-card.


== Background ==
== Background ==

Revision as of 00:28, 15 June 2013

<entry-title>h-card</entry-title> Tantek Çelik (Editor)


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

h-card is the microformats2 update to hCard.

Example

Here is a simple minimal person example:

<a class="h-card" href="http://example.com">Joe Bloggs</a>

And a slightly more complete example:

<p class="h-card">
  <img class="u-photo" href="http://example.org/photo.png" />
  <a class="p-name u-url" href="http://example.org">Joe Bloggs</a>
  <a class="u-email" href="mailto:joebloggs@example.com">joebloggs@example.com</a>
  <p class="p-adr h-adr">
    <span class="p-street-address">17 Austerstræti</span>
    <span class="p-locality">Reykjavík</span>
    <span class="p-country-name">Iceland</span>
  </p>
</p>

Get started

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

For minimal examples where at most p-name, u-url and u-photo are required (such as the first given above), only the root class name is needed — see implied properties.

For more complex examples, the root class name must be placed on an element which encloses all the desired properties, and then the properties themselves marked up using the classnames given below.

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

Properties

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

  • p-name - The full/formatted name of the person or organisation
  • p-honorific-prefix - e.g. Mrs., Mr. or Dr.
  • p-given-name - given (often first) name
  • p-additional-name - other/middle name
  • p-family-name - family (often last) name
  • p-sort-string - string to sort by
  • p-honorific-suffix - e.g. Ph.D, Esq.
  • p-nickname - nickname/alias/handle
  • u-email - email address
  • u-logo
  • u-photo
  • u-url - home page
  • u-uid - unique identifier
  • p-category - category/tag
  • p-adr - postal address, optionally a nested
    Main article: h-adr
  • p-post-office-box
  • p-extended-address
  • p-street-address - street number + name
  • p-locality - city/town/village
  • p-region - state/county/province
  • p-postal-code - postal code, e.g. US ZIP
  • p-country-name - country name
  • p-label
  • p-geo or u-geo, optionally a nested
    Main article: h-geo
  • p-latitude - decimal latitude
  • p-longitude - decimal longitude
  • p-altitude - decimal altitude
  • p-tel - telephone number
  • p-note - additional notes
  • dt-bday - birth date
  • u-key - cryptographic public key e.g. SSH or GPG
  • p-org - affiliated organisation, optionally a nested h-card
  • p-job-title - job title, previously 'title' in hCard, disambiguated.
  • p-role - description of role
  • u-impp per RFC 4770, new in vCard4 (RFC6350)
  • p-sex - biological sex, new in vCard4 (RFC6350)
  • p-gender-identity - gender identity, new in vCard4 (RFC6350)
  • dt-anniversary

Status

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

h-card is ready to use and implemented in the wild, but for backwards compatibility you should also mark h-cards up as classic hCards.

Property Details

(stub, to be expanded)

p-adr and its associated postal address properties can optionally use h-adr, for example:

<p class="p-adr h-adr">
  <span class="p-street-address">17 Austerstræti</span>
  <span class="p-locality">Reykjavík</span>
  <span class="p-country-name">Iceland</span>
</p>

Reserved properties (not used much, if at all, in practice):

  • p-organization-name
  • p-organization-unit
  • p-tz
  • dt-rev

Note: use of 'value' within 'tel' should be automatically handled by the support of the value-class-pattern. And for now, the 'type' subproperty of 'tel' is dropped/ignored. If there is demonstrable documented need for additional tel types (e.g. fax), we can introduce new flat properties as needed (e.g. p-tel-fax).

Examples in the wild

Real world in the wild examples:

Backward Compatibility

Publisher Compatibility

For backward compatibility, you may wish to use classic hCard classnames in addition to the more future-proof h-card properties, for example:

<span class="p-name fn n">Joe Bloggs</span>

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-card" is found, don't look for a "vcard" on the same element.

Compat. root class name: vcard
Properties: (parsed as p- plain text unless otherwise specified)

  • fn - parse as p-name
  • honorific-prefix
  • given-name
  • additional-name
  • family-name
  • honorific-suffix
  • nickname
  • email - parse as u-
  • logo - parse as u-
  • photo - parse as u-
  • url - parse as u-
  • uid - parse as u-
  • category
  • adr - parse as p-adr h-adr including compat root class adr
  • extended-address
  • street-address
  • locality
  • region
  • postal-code
  • country-name
  • label
  • geo - parse as p-geo h-geo including compat root class geo
  • latitude
  • longitude
  • tel
  • note
  • bday - parse as dt-
  • key - parse as u-
  • org
  • organization-name
  • organization-unit
  • title - parse as p-job-title
  • role

Reserved: (backward compat properties that parsers MAY implement, if they do, they MUST implement in this way:

  • tz
  • rev - parse as dt-


Background

This work is based on the existing hCard and vcard specifications.

Design Principles

(stub, expand)

See Also