Microformats (sometimes abbreviated μF) are simple conventions used to embed semantics in HTML and quickly provide an API to be used by search engines, aggregators, and other tools. These small patterns of HTML are used for marking entities that range from fundamental to domain-specific information, such as people, organizations, events, and locations.
Their simple format is not only useful for machines but it is also readable by any individual.
Several existing libraries have been specifically developed for microformats and they are not limited to hCard and hCalendar.
Microformats are supported by all major search engines.
Microdata are a WHATWG HTML specification,which is also used to nest metadata within existing content of web pages.
RDFa is a W3C standard, applying RDF to web pages.
Microformats are of no standard, although hCard and hCalendar conventions are widely used.
adr microformat represents an address, either for a physical location or a mailing address.
| || |
| ||The post office box number, if there is one.|
| ||The street address or addresses. The value is either undefined or a non-empty array where each element is a string.|
| ||The extended address.|
| ||The locality for the address.|
| ||The region for the address.|
| ||The postal or ZIP code for the address.|
| ||The name of the country in which the address is located.|
Returns the address as a string.
geo microformat represents a physical location on the planet Earth using latitude and longitude coordinates.
If a property is not marked as required, the value might be undefined.
| ||The latitude of the geographic location, represented as a floating-point number. Required.|
| ||The longitude of the geographic location, represented as a floating-point number. Required.|
Returns the location as a string.
geoString = geo.toString();
hCalendar microformat represents an appointment or other event on a calendar.
The class name is
vevent. There are two required properties:
Microformats.dateFromISO8601takes a normalized ISO 8601 date as its first parameter and returns the corresponding date.
| ||Zero or more categories with which the event is associated. If a category is also a |
| ||The classification of the event. This is one of |
| ||An description of the event, using HTML. The value is some kind of object.|
| ||The date and time at which the event begins, normalized to an ISO8601 date. Required.|
| ||The date and time at which the event ends, normalized to an ISO8601 date.|
| ||The date and time at which the calendar entry was created, normalized to an ISO8601 date.|
| ||The length of the event. This can be things such as "1w" for one week, or "1h" for one hour. See the description in RFC 2445 for details.|
| ||A physical location associated with the event. The value is a |
| ||A location at which the event is to take place. The value is either a string or an |
| ||The status of the event. This can be one of |
| ||A brief description of the event. Required.|
| ||Specifies whether or not the event should be ignored when searching for openings in the user's calendar. If this value is |
| ||A unique ID for the event.|
| ||A URL associated with the event.|
| ||The date and time at which the event was last modified, normalized to an ISO8601 date.|
| ||Specifies recurrence rules for the event. See RFC 2445 for details. I am not sure what the type of the value is. Reading may throw an exception.|
hCard microformat describes an entry in a contact database, as a virtual business card.
The value of each property is a string unless anything else is specified. If a property is not marked as required, the value might be undefined. If a property is marked as plural, the value is either undefined or a non-empty array. Each element in the array is a string unless anything else is specified. The values of the
tel properties are not fully documented.
| ||The contact's address. Plural. Each element is an |
| ||People who act as agents on behalf of the contact. Plural. Each element is either a string or an |
| ||The contact's birthdate.|
| ||A class for the contact.|
| ||Category with which the contact is associated. If a category is also a |
|Zero or more email addresses for the contact. Each email address entry includes two subproperties, both of which are plural: |
| ||The contact's full name. Required.|
| ||The contact's physical location. The value is a |
| ||The contact's public key, for exchanging encrypted data with the contact. Plural.|
| ||Formatted text providing an address label for the contact. Plural.|
| ||Optional URI to a graphic image of a logo for the contact; this can be used for a company logo, for example. Plural.|
| ||The type of email software used by the contact. Plural.|
| ||The contact's name. This has the following subproperties: |
| ||Nickname for the contact. Plural.|
| ||HTML note with additional information about the contact. Plural. Each element is some kind of object.|
| ||The organization with which the contact is associated. This includes the following subproperties: |
| ||URI providing a photograph of the contact. Plural.|
| ||The date and time at which the contact was last revised.|
| ||Role which the contact fills within his or her organization. Plural.|
| ||A revision number for the contact. Each time the contact is revised, this number should be incremented, if this property is used at all. (The value is a string)|
| ||If provided, this string is used instead of the |
| ||URI specifying a sound file associated with the contact. Plural.|
| ||Job title for the contact. Plural.|
| ||The contact's telephone number. Plural. Each element has the following subproperties: |
| ||The contact's time zone.|
| ||A unique UID for this contact.|
| ||URL associated with the contact. Plural.|
tag microformat is used to add tags to other microformats.
The value of each property is a
| ||The name of the tag. This is the text after the last forward slash in the link. Required.|
| ||A URL associated with the tag. Required.|
| ||The text associated with the tag. Required.|
Returns the tag as a string.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.