This document represents a draft microformat specification. Although drafts are somewhat mature in the development process, the stability of this document cannot be guaranteed, and implementers should be prepared to keep abreast of future developments and changes. Watch this wiki page, or follow discussions on the #microformats Freenode IRC channel to stay up-to-date.
hAtom is a microformat for content that can be syndicated, primarily but not exclusively weblog postings. hAtom is based on a subset of the Atom syndication format. hAtom will be one of several microformats open standards.
hAtom 0.1 is a microformats.org draft specification. Public discussion on hAtom takes place on hatom-feedback, the #microformats irc channel on irc.freenode.net, and microformats-discuss mailing list.
The English version of this specification is the only normative version. For translations of this document see the #translations section.
Errata and Updates
The hAtom 0.2 update is currently under development and incorporates known errata corrections as well as the value-class-pattern.
hAtom is a microformat for identifying semantic information in weblog posts and practically any other place Atom may be used, such as news articles. hAtom content is easily added to most blogs by simple modifications to the blog's template definitions.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
Here is a simple blog post example:
<article class="hentry"> <h1 class="entry-title">Microformats are amazing</h1> <p>Published by <span class="author vcard"><span class="fn">W. Developer</span></span> on <time class="published" datetime="2013-06-13 12:00:00">13<sup>th</sup> June 2013</time> <p class="entry-summary">In which I extoll the virtues of using microformats.</p> <div class="entry-content"> <p>Blah blah blah</p> </div> </article>
hentry is a root class name that indicates the presence of an hAtom entry.
entry-content and the other hAtom property classnames listed below define properties of the entry.
The Atom Syndication Format provides the conceptual basis for this microformat, with the following caveats:
- Atom provides a lot more functionality than we need for a "blog post" microformat, so we've taken the minimal number of elements needed.
- the "logical" model of hAtom is that of Atom. If there is a conflict, Atom should be taken as correct.
- the "physical" model of hAtom -- the actual writing of elements -- is a lot more varied than Atom provides for, due to the variety of ways weblogs are actually produced in the wild. The hAtom microformat provides a number of rules for "bridging the gap"
Schema elements are based on the Atom nomenclature and follow the microformat pattern of prefixing a unique identifier (in this case, '
h') on the outermost container elements -- the Feed or Entry. The parts of this microformat are based on analysis of many weblog, bulletin board and media posts and can be read blog-post-brainstorming#Discovered_Elements.
The hAtom schema consists of the following:
- hfeed (
feed category. optional. keywords or phrases, using rel-tag.
- hentry (
entry-title. required. text.
entry-content. optional (see field description). text. [*]
entry-summary. optional. text.
updated. required using value class pattern date and time. [*]
published. optional using value class pattern date and time.
author. required using hCard. [*]
bookmark(permalink). optional, using rel-bookmark.
- tags. optional. keywords or phrases, using rel-tag.
[*] Some required elements have defaults if missing, see below.
Field and Element Details
- a Feed element is identified by the class name
- a Feed element represents the concept of an Atom feed
- the Feed element is optional and, if missing, is assumed to be the page
- hAtom documents MAY have multiple Feed elements
- a Feed Category element is identified by rel-tag
- a Feed MAY have a Feed Category
- a Feed Category element represents the concept of an Atom category inside a feed
- Feed Category elements MUST appear inside a Feed element but not inside an Entry element
- the rel-tag
hrefencodes the atom
category:term; the link text defines the atom
- an Entry element is identified by class name
- an Entry element represents the concept of an Atom entry
- any microformat content inside a
<q>element within the Entry should not be considered part of the Entry.
- This allows quoting other microformated data without worry of corrupting the model
- an Entry Category element is identified by rel-tag
- an Entry MAY have an Entry Category
- an Entry Category element represents the concept of an Atom category inside an entry
- the rel-tag
hrefencodes the atom
category:term; the link text defines the atom
- an Entry Title element is identified by the class name
- an Entry SHOULD have an Entry Title
- an Entry Title element represents the concept of an Atom entry title
- if the Entry Title is missing, use
- the first
<h#>element in the Entry, or
<title>of the page, if there is no enclosing Feed element, or
- assume it is the empty string
- the first
- an Entry Content element is identified by class name
- an Entry SHOULD have Entry Content
- an Entry Content element represents the concept of an Atom content
- an Entry MAY have 0 or more Entry Content elements. The "logical Entry Content" of an Entry is the concatenation, in order of appearance, of all the Entry Contents within the Entry
- if the Entry Content is missing, assume it is the empty string
- an Entry Summary element is identified by class name
- an Entry Summary element represents the concept of an Atom summary
- an Entry MAY have 0 or more Entry Summary elements. The "logical Entry Summary" of an Entry is the concatenation, in order of appearance, of all the Entry Summarys within the Entry
- an Entry Permalink element is identified by rel-bookmark
- an Entry SHOULD have an Entry Permalink
- an Entry Permalink element represents the concept of an Atom link in an entry
- if the Entry Permalink is missing, use the URI of the page; if the Entry has an "id" attribute, add that as a fragment to the page URI to distinguish individual entries
- an Entry Updated element is identified by class name
- an Entry Updated element represents the concept of Atom updated
- an Entry SHOULD have an Entry Updated element
- use the value class pattern date and time to encode the updated datetime
- if there is no Entry Updated element,
- use the Entry Published element, if present
- otherwise the page is invalid hAtom
- an Entry Published element is identified by the class name
- an Entry Published element represents the concept of Atom published
- use the value class pattern date and time to encode the published datetime
- an Entry Author element is represented by class name
- an Entry Author element represents the concept of an Atom author
- an Entry Author element MUST be encoded in an hCard
- an Entry Author element SHOULD be encoded in an
- an Entry SHOULD have at least one Entry Author element
- an Entry MAY have more than one Entry Author elements
- if the Entry Author is missing
Examples in the wild
This specification is (C) 2005-2015 by the authors. However, the authors intend to submit this specification to a standards body with a liberal copyright/licensing policy such as the GMPG, IETF, and/or W3C. Anyone wishing to contribute should read their copyright principles, policies and licenses (e.g. the GMPG Principles) and agree to them, including licensing of all contributions under all required licenses (e.g. CC-by 1.0 and later), before contributing.
- Tantek: I release all my contributions to this specification into the public domain and I encourage the other authors to do so as well.
- When all authors/editors have done so, we can remove the MicroFormatCopyrightStatement template reference and replace it with the MicroFormatPublicDomainContributionStatement.
Semantic HTML Design Principles
- Reuse the schema (names, objects, properties, values, types, hierarchies, constraints) as much as possible from pre-existing, established, well-supported microformats.
- When new schema are needed, reuse the schema (names, objects, properties, values, types, hierarchies, constraints) as much as possible from pre-existing, established, well-supported other formats/standards by incorporation, following the microformats naming-principles. Re-do constraints expressed in the source standard from the perspective of microformats design principles and designed primarily for web authoring. Informatively mention source standard for reference purposes.
- For types with multiple components, use nested elements with class names equivalent to the names of the components.
- Plural components are made singular, and thus multiple nested elements are used to represent multiple text values that are comma-delimited.
- Use the most accurately precise semantic HTML building block for each object etc.
- Otherwise use a generic structural element (e.g.
<div>), or the appropriate contextual element (e.g. an
- Use class names based on names from the original schema, unless the semantic HTML building block precisely represents that part of the original schema. If names in the source schema are case-insensitive, then use an all lowercase equivalent. Components names implicit in prose (rather than explicit in the defined schema) should also use lowercase equivalents for ease of use. Spaces in component names become dash '-' characters.
- Finally, if the format of the data according to the original schema is too long but still human readable/listenable, use
<abbr>instead of a generic structural element, and place the literal longer data into the 'title' attribute (where abbr expansions go), and the briefer equivalent into the contents of the element itself. If however, the format of the literal longer data data is not human-friendly, instead of
<abbr>, use the value-class-pattern or HTML5
<time>/<data>elements as most semantically appropriate.
Work in progress
This specification is a work in progress. As additional aspects are discussed, understood, and written, they will be added. There is a separate document where we are keeping our brainstorms and other explorations relating to hAtom:
Version 0.1 was released 28 February 2006.
- If you have any questions about hAtom, check the hAtom FAQ, and if you don't find answers, add your questions!
- Please add any issues with the specification to the separate hAtom issues document.
- h-entry - latest markup spec for Atom entries in HTML
- h-feed - brainstorm/experiment for feeds in HTML
- hAtom - the draft proposal.
- hAtom Cheatsheet - hAtom properties.
- hAtom Examples, in the Wild
- hAtom Hints - help for implementors.
- hAtom Issues - problems? complaints? ideas? Put them here.
- hatom-brainstorming - active work on iterations toward the next version of hAtom
- hAtom FAQ - knowledge base.
- hAtom advocacy - encourage others to use hAtom.
- rel-enclosure - how to semantically reference enclosures (e.g. podcasts) in hAtom
- blog-description-format - how to describe a blog (as opposed to the individual entries, which is what we're doing here)
Read the hAtom draft specification in additional languages: