hcard-cheatsheet: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
m (cheatsheet template)
(→‎Properties: rekeyed)
Line 3: Line 3:
==Properties==
==Properties==


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


===Key===
{{cheatsheet-key}}
:1 - '''Single occurrence required'''
;pref:preferred
:2 - '''''One or more, required''''' (n/a)
;dom:domestic
:3 - single occurrence optional
;intl:international
:4 - ''zero or more occurrence''
;cell:mobile
:[square brackets] - common list of values
:(data format)
 
:pref = preferred
:dom = domestic
:intl = international
:cell = mobile


==Notes==
==Notes==
* <code>URL</code> in vCard becomes  <code><a class="url" href="...">...</a></code> inside the element with <code>class="vcard"</code> in hCard.
* <code>URL</code> in vCard becomes  <code><a url href=...>...</a></code> inside the element with <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 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 photo src=... alt=Photo of ... /></code> or <code><object 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.


===Geo===
===Geo===
*If latitude is present, so MUST be longitude, and vice versa.
*If latitude is present, so MUST be longitude, and vice versa.
*If the secondary classes are omitted, the two values MUST be comma separated and latitude MUST be first:<code><nowiki><span class=geo">37.386013,-122.082932</span></nowiki></code>
*If the secondary classes are omitted, the two values MUST be comma separated and latitude MUST be first:<code><nowiki><span class=geo>37.386013,-122.082932</span></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.



Revision as of 23:54, 4 December 2006

hCard cheetsheet

Properties

  • vcard
    • 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
    • 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 url href=...>...</a> inside the element with vcard in hCard.
  • Similarly, EMAIL in vCard becomes <a email href=mailto:...>...</a>
  • PHOTO in vCard becomes <img photo src=... alt=Photo of ... /> or <object photo data=... type=...>Photo of ...</object>
  • UID in vCard simply becomes another semantic applied to a specific URL (or EMAIL) for an hCard.

Geo

  • If latitude is present, so MUST be longitude, and vice versa.
  • If the secondary classes are omitted, the two values MUST be comma separated and latitude MUST be first:<span class=geo>37.386013,-122.082932</span>
  • The same number of decimal places SHOULD be used in each value.

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.