Wikipedia:WikiProject Microformats/hcard

From Wikipedia, the free encyclopedia
Jump to: navigation, search

hCard[edit]

hCard is a microformat for contact details of people (who could be in either articles or user profiles), companies, organizations, and places.

This page considers how it might be deployed on Wikipedia.

There are moves to extend hCard to include date-of-death, which will be useful for biography pages, and to add a "gender" property, which will aid genealogists.

hCard allows for data to be entered into address books, or used as Geo (see Wikipedia:WikiProject Microformats#Geo; Geo is a subset of hCard). It also allows birth dates (death date inclusion is pending) to be added to calendars as recurring events (including those for dead people, so that the anniversaries may be celebrated).

Potential[edit]

See also Wikipedia:Persondata and this comparison of persondata and hCard

Adr[edit]

The Adr microformat is a sub-set of hCard, but may also be used stand-alone. It is for marking-up postal addresses and their individual components.

An example of good practice, in having granular address components, rather than a single address field, inside hCard is {{Infobox School}}. For stand-alone use, see Category:Templates generating ADR microformats. Where address data is entered in a non-granular form, the hCard label property should be used, instead of adr.

Adding adr to some Infoboxes, with a row for each address component, is difficult, because of the need to wrap class="adr" around several table rows, but not the whole table. In this case, the most useful address component should be marked up.

Extension[edit]

An extension (RFC 6474) for death-date, place-of-birth and place-of-death was published in December 2011.

It is proposed to use the following class names:

  • deathdate
  • birthplace
  • deathplace

The first of these will need to be baked into date calculation templates.

Note that the latter two may take a ADR microformat and/ or a geo microformat; (or a URI; not useful on Wikipedia) (as emitted by {{Coord}}).

Proposal: Where a microformat parser encounters a BIRTHPLACE or DEATHPLACE value which is text, but not formatted as an ADR, GEO or URI, treat it as vCard 4.0's ADR:LABEL.

Sample mark-up[edit]

For sample hCard mark-up, please see hCard or pages linked from the hCard spec on microformats.org.

Relevant Templates[edit]

  • {{Hcard-bday}} - inline fn and bday, for a living or dead person.
  • {{Hcard-geo}} - inline fn-org and coordinates, for a building, organisation or venue.
  • {{PoI}} (and related) - table rows as hCards, with Geo.
    • {{PoIgb}} - GB version, with OS Grid Refs.

Birth date[edit]

  • {{Birth date and age}}, {{Birth date}} and {{BirthDeathAge}}, for example, {{birth date and age|1926|5|8}}, output the "bday" property in the form, effectively:
    • 8 May 1926 (age 80)<br style="display:none;" /><span style="display:none;">(<span class="bday">1926-05-08</span>)</span>
  • {{Start date}} & {{ISO date}} output the "bday" property, in YYYY-MM-DD, YYYY-MM & YYYY formats, for use in the hCards of organisations, venues and places.
  • {{Hcard-bday}} and {{Hcard-bday-place}} wrap the above in an hCard with a name inside a <span class="fn">.
  • {{death date and age}}, such as {{death date and age|1974|11|25|1948|6|19}}
    • To be modified as above, pending addition of death date field to hCard

Sample mark-up[edit]

For a two column table, showing name and coordinates, with one hCard on each row:

|- class="vcard"
|class="fn org"|Blackroot Pool
|{{coord|52.5726|-1.8428}}

hCard examples on Wikipedia[edit]

See: Category:Templates generating hCards

Examples:

In templates[edit]

Infoboxes for people[edit]

Will display "bday" if {{Birth date}} or {{Birth date and age}} is used.

Infoboxes for places[edit]

Pages needing hCard[edit]

These pages need the manual addition of hCard; or perhaps conversion to tables, with hCard included:

For tables needing hCard, see Category:Lists of coordinates.