h-adr: Difference between revisions
(note backcompat root and property class names) |
(all properties optional, validating, embedding) |
||
Line 35: | Line 35: | ||
* '''<code>p-country-name</code>''' - country name | * '''<code>p-country-name</code>''' - country name | ||
* '''<code>p-label</code>''' - a mailing label, plain text, perhaps with preformatting | * '''<code>p-label</code>''' - a mailing label, plain text, perhaps with preformatting | ||
* '''<code>p-geo</code>''' (or u-geo with a RFC 5870 geo: URL), optionally | * '''<code>p-geo</code>''' (or u-geo with a RFC 5870 geo: URL), optionally embedded [[h-geo]] | ||
* '''<code>p-latitude</code>''' - decimal latitude | * '''<code>p-latitude</code>''' - decimal latitude | ||
* '''<code>p-longitude</code>''' - decimal longitude | * '''<code>p-longitude</code>''' - decimal longitude | ||
* '''<code>p-altitude</code>''' - decimal altitude - new in vCard4 (RFC6350) | * '''<code>p-altitude</code>''' - decimal altitude - new in vCard4 (RFC6350) | ||
All properties are optional. | |||
== Status == | == Status == | ||
Line 50: | Line 52: | ||
== Examples in the Wild == | == Examples in the Wild == | ||
* … add any h-adr examples you find in the wild | * … add any h-adr examples you find in the wild | ||
== Validating == | |||
{{main|validators}} | |||
Test and validate your [[h-adr]] markup with: | |||
* http://waterpigs.co.uk/php-mf2/ - enter your markup directly | |||
* http://pin13.net/ - enter a URL to a page to test where it says "Microformats Parser" | |||
== Backward Compatiblity == | == Backward Compatiblity == | ||
Line 87: | Line 95: | ||
== See Also == | == See Also == | ||
* [[microformats2]] | * [[microformats2]] | ||
* [[h-geo]] can be | * [[h-geo]] can be embedded in h-adr | ||
* [[h-card]] and [[h-event]] often contain h-adr | * [[h-card]] and [[h-event]] often contain h-adr | ||
[[Category:Draft Specifications]] | [[Category:Draft Specifications]] |
Revision as of 23:19, 18 June 2013
<entry-title>h-adr</entry-title> Tantek Çelik (Editor)
h-adr is a simple, open format for publishing structured locations such as addresses, physical and/or postal. h-adr is one of several open microformat draft standards suitable for embedding data in HTML/HTML5 on the web.
h-adr is the microformats-2 update to adr. It is most commonly used as part of an h-card or h-event.
Example
Here is a simple postal address example:
<p class="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>
<span class="p-postal-code">107</span>
</p>
Get started
The class h-adr
is a root class name that indicates the presence of an h-adr.
p-street-address, p-locality, p-country-name, p-postal-code and all the other h-adr property class names listed below define properties of the h-adr.
See microformats-2-parsing to learn more about property class names.
Properties
h-adr properties, inside an element with class h-adr:
p-street-address
- house/apartment number, floor, street namep-extended-address
- additional street detailsp-post-office-box
- post office mailboxp-locality
- city/town/villagep-region
- state/county/provincep-postal-code
- postal code, e.g. ZIP in the USp-country-name
- country namep-label
- a mailing label, plain text, perhaps with preformattingp-geo
(or u-geo with a RFC 5870 geo: URL), optionally embedded h-geop-latitude
- decimal latitudep-longitude
- decimal longitudep-altitude
- decimal altitude - new in vCard4 (RFC6350)
All properties are optional.
Status
h-adr is a microformats.org draft specification. Public discussion on h-adr takes place on h-adr-feedback, the #microformats irc channel on irc.freenode.net, and microformats-new mailing list.
h-adr is ready to use and implemented in the wild, but for backwards compatibility you should also mark h-adrs up with classic adr classnames.
Property Details
(stub, add any property explanations here)
Examples in the Wild
- … add any h-adr examples you find in the wild
Validating
Test and validate your h-adr markup with:
- http://waterpigs.co.uk/php-mf2/ - enter your markup directly
- http://pin13.net/ - enter a URL to a page to test where it says "Microformats Parser"
Backward Compatiblity
Publisher Compatibility
For backward compatibility, you may wish to use classic adr classnames in addition to the more future-proof h-adr properties, for example:
<p class="h-adr adr">
<span class="p-street-address street-address">123 Main St.</span>,
<span class="p-locality locality">Pleasantville</span>
...
</p>
The class adr
is a backward compatible root class name that indicates the presence of an adr.
street-address, locality, and all the other backward compatibility adr property class names are listed below.
Parser Compatibility
Microformats parsers should detect classic properties and parse them as microformats 2 properties. If an "h-adr" is found, don't look for an "adr" on the same element.
Compatibility root class name: adr
Properties: (parsed as p- plain text unless otherwise specified)
- post-office-box
- extended-address
- street-address
- locality
- region
- postal-code
- country-name
Background
h-adr is based on the existing adr specification, which was extracted from hCard in order to allow it to be used for applications other than contact information.
See Also
- microformats2
- h-geo can be embedded in h-adr
- h-card and h-event often contain h-adr