hcard-cheatsheet: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(→‎Geo: "Coordinates MAY be combined a single...")
(fixing URL in Notes)
Line 67: Line 67:


===Notes===
===Notes===
* <code>URL</code> in vCard becomes  <code><a url href=...>...</a></code> inside the element with <code>vcard</code> in hCard.
* <code>URL</code> in vCard becomes  <code><a class="url" href=...>...</a></code> inside the element with class <code>vcard</code> in hCard.
* Similarly, <code>EMAIL</code> in vCard becomes <code><nowiki><a class="email" href=mailto:...>...</a></nowiki></code>
* Similarly, <code>EMAIL</code> in vCard becomes <code><nowiki><a class="email" href="mailto:...">...</a></nowiki></code>
* <code>PHOTO</code> in vCard becomes <code><img class="photo" src=... alt=Photo of ... /></code> or <code><object class="photo" data=... type=...>Photo of ...</object></code>
* <code>PHOTO</code> in vCard becomes <code><img class="photo" src=... alt="Photo of ..." /></code> or <code><object class="photo" data=... type=...>Photo of ...</object></code>
* <code>UID</code> in vCard simply becomes another semantic applied to a specific URL (or EMAIL) for an hCard.
* <code>UID</code> in vCard simply becomes another semantic applied to a specific URL (or EMAIL) for an hCard.
*If an adr-child (e.g ''street-address'') is present it will ONLY be considered part of the hCard data IF it is inside an ''adr''.
* If an adr-child (e.g ''street-address'') is present it will ONLY be considered part of the hCard data IF it is inside an ''adr''.


====Geo====
====Geo====
*If latitude is present, so MUST be longitude, and vice versa.
* If latitude is present, so MUST be longitude, and vice versa.
*Coordinates MAY be combined a single &lt;abbr&gt; element; then the latitude and longitude MUST be separated by a semicolon in the title attribute and latitude MUST be first:
* Coordinates MAY be combined a single &lt;abbr&gt; element; then the latitude and longitude MUST be separated by a semicolon in the title attribute and latitude MUST be first:
:<code><nowiki><abbr class="geo" title="37.386013;-122.082932">home</abbr></nowiki></code>
:<code><nowiki><abbr class="geo" title="37.386013;-122.082932">home</abbr></nowiki></code>
*The same number of decimal places SHOULD be used in each value.
* The same number of decimal places SHOULD be used in each value.
*Coordinates use the datum of [http://en.wikipedia.org/wiki/World_Geodetic_System WGS84].
* Coordinates use the datum of [http://en.wikipedia.org/wiki/World_Geodetic_System WGS84].


==Related pages==
==Related pages==
{{hcard-related-pages}}
{{hcard-related-pages}}
*{{cheatsheets}}
*{{cheatsheets}}

Revision as of 09:24, 19 December 2006

hCard cheetsheet

Profile

<head profile="http://www.w3.org/2006/03/hcard">

Properties (Class Names)

  • vcard {1}
    • adr*
      • type [work|home|pref|postal|dom|intl]?
      • post-office-box?
      • street-address*
      • extended-address?
      • region?
      • locality?
      • postal-code?
      • country-name?
    • agent*
    • bday? (ISO date)
    • class? confidentiality/access classification of the entire hCard
    • category*
    • email*
      • type?
      • value?
    • fn {1}
    • geo?
      • latitude?
      • longitude?
    • key*
    • label*
    • logo*
    • mailer*
    • n?
      • honorific-prefix*
      • given-name*
      • additional-name*
      • family-name*
      • honorific-suffix*
    • nickname*
    • note*
    • org*
      • organization-name?
      • organization-unit*
    • photo*
    • rev? datetime of the revision of the entire hCard
    • role*
    • sort-string?
    • sound*
    • title*
    • tel* (Note E.123 for formatting info.)
      • type [home|work|pref|fax|cell|pager]?
      • value?
    • tz? timezone of the person
    • uid? applies to the entire hCard
    • url*

Key

Based on Perl's standard quantifiers:

bold {1} MUST be present exactly once
italic* OPTIONAL, and MAY occur more than once
+ MUST be present, and MAY occur more than once
? OPTIONAL, but MUST NOT occur more than once
[square brackets] list of common values
(parentheses) data format
# comment
! awaiting documentation
pref preferred
dom domestic
intl international
cell mobile

Notes

  • URL in vCard becomes <a class="url" href=...>...</a> inside the element with class vcard in hCard.
  • Similarly, EMAIL in vCard becomes <a class="email" href="mailto:...">...</a>
  • PHOTO in vCard becomes <img class="photo" src=... alt="Photo of ..." /> or <object class="photo" data=... type=...>Photo of ...</object>
  • UID in vCard simply becomes another semantic applied to a specific URL (or EMAIL) for an hCard.
  • If an adr-child (e.g street-address) is present it will ONLY be considered part of the hCard data IF it is inside an adr.

Geo

  • If latitude is present, so MUST be longitude, and vice versa.
  • Coordinates MAY be combined a single <abbr> element; then the latitude and longitude MUST be separated by a semicolon in the title attribute and latitude MUST be first:
<abbr class="geo" title="37.386013;-122.082932">home</abbr>
  • The same number of decimal places SHOULD be used in each value.
  • Coordinates use the datum of WGS84.

Related pages

The hCard specification is a work in progress. As additional aspects are discussed, understood, and written, they will be added. These thoughts, issues, and questions are kept in separate pages.