hatom: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(s/<source>/<syntaxhighlight>/)
 
(300 intermediate revisions by 64 users not shown)
Line 1: Line 1:
= hAtom =
{{DISPLAYTITLE:hAtom 0.1}}
{{latest|h-entry}}
{{Template:DraftSpecification}}


hAtom is a microformat for content that can be syndicated, primarily but not exclusively weblog postings. hAtom is a strongly based on a subset of the [http://www.atomenabled.org/ Atom] syndication format; every concept in hAtom has a corresponding definition in Atom.  
hAtom is a microformat for content that can be syndicated, primarily but not exclusively weblog postings. hAtom is based on a subset of the [http://www.atomenabled.org/ Atom] syndication format. hAtom will be one of several [[microformats]] open standards.
__TOC__
== Draft Specification ==


This microformat is a draft; please address your concerns, issues, comments, etc. in [[hatom-issues]].
<div class="vcard">
;<span class="role">Editor/Author</span>
:<span class="fn">[http://blogmatrix.blogmatrix.com/ David Janes]</span> <span class="org">([http://www.blogmatrix.com BlogMatrix, Inc.])</span>
</div>


__TOC__
;Contributors
:<span class="vcard"><span class="fn">[http://members.optusnet.com.au/benjamincarlyle/benjamin/blog/ Benjamin Carlyle]</span></span>
:<span class="vcard"><span class="fn">[[User:Tantek|Tantek Çelik]]</span> (<span class="url">http://tantek.com/</span> and before at [http://technorati.com Technorati, Inc.])</span>


== Draft Specification ==
[[hatom#Copyright|copyright]] and [[hatom#Patents|patents]] statements apply.


=== Editor ===
== Status ==
* [http://blogmatrix.blogmatrix.com/ David Janes], [http://www.blogmatrix.com BlogMatrix, Inc.]
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 [http://microformats.org/discuss/mail/microformats-discuss/ microformats-discuss mailing list].


=== Authors ===
=== Available languages ===
* [http://blogmatrix.blogmatrix.com/ David Janes], [http://www.blogmatrix.com BlogMatrix, Inc]
The English version of this specification is the only normative version. For translations of this document see the [[#translations]] section.


=== Copyright ===
=== Errata and Updates ===
{{MicroFormatCopyrightStatement2005}}
Known errors and issues in this specification are corrected in [[hatom-issues-resolved|resolved]] and [[hatom-issues-closed|closed]] issues. Please check there before reporting [[hatom-issues|issues]].


=== Patents ===
The hAtom 0.2 update is currently under development and incorporates known errata corrections as well as the [[value-class-pattern]].
{{MicroFormatPatentStatement}}


== Introduction ==
== Introduction ==
hAtom is a [[microformat]] for identifying semantic information in weblog posts and practically any other place [http://www.atomenabled.org/ 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.
{{rfc-2119-intro}}
== Example ==
Here is a simple blog post example:
<syntaxhighlight lang="html">
<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>
 
  <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>
</syntaxhighlight>
=== Get started ===
The class '''<code>hentry</code>''' is a ''root class name'' that indicates the presence of an hAtom entry.


== Semantic XHTML Design Principles ==
'''<code>entry-title</code>''', '''<code>author</code>''', '''<code>published</code>''', '''<code>entry-summary</code>''', '''<code>entry-content</code>''' and the other hAtom property classnames listed below define properties of the entry.
{{semantic-xhtml-design-principles}}


== Format ==
== Format ==
Line 30: Line 60:
The [http://atomenabled.org/developers/syndication/#person Atom Syndication Format] provides the conceptual basis for this microformat, with the following caveats:
The [http://atomenabled.org/developers/syndication/#person Atom Syndication Format] provides the conceptual basis for this microformat, with the following caveats:


* Atom provides a lot more functionality that we need for a "blog post" microformat, so we've taken the minimal number of elements needed. This can (and probably should) be expanded.
* 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 "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 "briding the gap"
* 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"
:: ''for example, if an entry is missing an author (required by Atom), it is assumed to be that of the XHTML page''


=== Schema ===
=== Schema ===
Schema elements are based on the Atom nomenclature and follow the microformat pattern of prefixing a unique identifier (in this case, <code>atom</code>) 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]]. Note the renaming of 'EntryGroup' to 'Feed' to be more consistent with Atom ternminology.
Schema elements are based on the Atom nomenclature and follow the microformat pattern of prefixing a unique identifier (in this case, '<code>h</code>') 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]].


==== Nomenclature ====
The hAtom schema consists of the following:


{| width="100%" border="1" cellspacing="0"
* hfeed ('''<code>hfeed</code>'''). optional.
|-
** '''<code>feed category</code>'''. optional. keywords or phrases, using '''[[rel-tag]]'''.
! width="150" | Concept
** [[hentry]] ('''<code>hentry</code>''').  
! Atom Identifier
*** '''<code>entry-title</code>'''. required. text.
! hAtom Microformat Usage
*** '''<code>entry-content</code>'''. optional (see field description). text. [*]
|-
*** '''<code>entry-summary</code>'''. optional. text.
| Feed
*** '''<code>updated</code>'''. required using [[value-class-pattern#Date_and_time_parsing|value class pattern date and time]]. [*]
| <code>atom:feed</code>
*** '''<code>published</code>'''. optional using [[value-class-pattern#Date_and_time_parsing|value class pattern date and time]].
| add <code>class="feed"</code>
*** '''<code>author</code>'''. required using '''[[hcard|hCard]]'''. [*]
|-
*** '''<code>bookmark</code>''' (permalink). optional, using '''[[rel-bookmark]]'''.
| Feed Title
*** tags. optional. keywords or phrases, using '''[[rel-tag]]'''.
| <code>atom:title</code>
| ''Not defined in the first iteration of this proposal.''
|-
| Feed Permalink
| <code>atom:link@rel=alternate</code>
| ''Not defined in the first iteration of this proposal.''
|-
| Entry
| <code>atom:entry</code>
| Add <code>class="entry"</code>; if practical, also define <code>id="unique-identifier"</code> to the Entry.
|-
| Entry Title
| <code>atom:title</code>
| Use <code>&lt;h#></code> in block elements; OR non-preferentially add <code>class="title"</code> in inline elements.
|-
| Entry Content
| <code>atom:content</code>
| Add <code>class="content"</code> to all appropriate blocks. Multiple Entry Content blocks are logically considered one concatenated <code>atom:content</code> equivalent.
|-
| Entry Summary
| <code>atom:summary</code>
| Add <code>class="summary"</code> to all appropriate blocks. Multiple Entry Summary blocks are logically considered one concatenated <code>atom:summary</code> equivalent.
|-
| Entry Permalink
| <code>atom:link</code>
| Add <code>rel="bookmark"</code>.
|-
| Entry Published
| <code>atom:published</code>
| Use <code>&lt;abbr class="published" title="YYYYMMYYThh:mm:ss&plusmn;ZZ:ZZ"></code>...<code>&lt;/abbr></code>, following the [[datetime-design-pattern]].
|-
| Entry Author
| <code>atom:author</code>
| Use <code>&lt;address></code>...<code>&lt;/address></code>. Adding <code>class="author"</code> is optional. Adding a [[hcard|hCard]] is highly recommended.
|-
| Entry Contributor
| <code>atom:contibutor</code>
| Use <code>&lt;address class="contributor"></code>...<code>&lt;/address></code>. Adding a [[hcard|hCard]] is highly recommended.
|}


==== Nesting Rules ====
[*] Some required elements have defaults if missing, see below.


{| width="100%" border="1" cellspacing="0"
=== Field and Element Details ===
|-
! Concept
! Nests In
! hAtom Opaque
! Cardinality
! Logical Cardinality
|-
| Feed
| HTML document
| No
| 1-N
| 1-N
|-
| Entry
| Feed
| No
| 0-N
| 0-N
|-
| Entry Title
| Entry<br />Entry Permalink
| No
| 0-N
| 0-1
|-
| Entry Content
| Entry
| Yes
| 0-N
| 0-1
|-
| Entry Summary
| Entry
| Yes
| 0-N
| 0-1
|-
| Entry Permalink
| Entry<br />Entry Title<br />Entry Published
| No
| 0-N
| 1
|-
| Entry Published
| Entry<br />Entry Permalink
| No
| 0-N
| 0-1
|-
| Entry Author
| Entry
| Yes
| 0-N
| 1-N
|-
| Entry Contibutor
| Entry
| Yes
| 0-N
| 0-N
|}


===== hAtom Opaque =====
===== Feed =====
* a Feed element is identified by the class name <code>hfeed</code>
* a Feed element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.1.1 Atom feed]
* the Feed element is optional and, if missing, is assumed to be the page
* hAtom documents {{may}} have multiple Feed elements


"hAtom Opaque" specifies whether a hAtom parser should "look inside" the element for further hAtom content. If there are multiple rules applied to the same element take the OR of the two (i.e. "Yes" always wins)
===== Feed Category =====
* 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 [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.2 Atom category] inside a [http://www.atomenabled.org/developers/syndication/#optionalFeedElements feed]
* Feed Category elements {{must}} appear inside a Feed element but not inside an Entry element
* the [[rel-tag]] <code>href</code> encodes the atom <code>category:term</code>; the link text defines the atom <code>category:label</code>


: ''hAtom Opaque is designed to make parsing rules less ambiguous. In particular, it allows "quoted" hAtom elements (from another blog being blockquoted, for example) ti be ignored. It also allows 'embedded' hAtom to be potentially delivered within hAtom itself, and to prevent accidental 'leaking' of other microformat information up into the hAtom container.''
===== Entry =====
 
* an Entry element is identified by class name <code>hentry</code>
===== Cardinality =====
* an Entry element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.1.2 Atom entry]
 
* any microformat content inside a <code>&lt;blockquote></code> or <code>&lt;q></code> element within the Entry should not be considered part of the Entry.
How many times can an element of the given type appear in it's nesting/parent element.
: ''This allows quoting other microformated data without worry of corrupting the model''
 
===== Logical Cardinality =====
 
From a modeling/logical perspective, the number of times can an element appear.
 
: ''This is all rule dependent, see below. For example, an Entry Permalink may appear 6 times, but each one must be the same value; an Entry Content element may appear 3 times, but they are all concatenated together to make a single logical element.''
 
==== Rules and Definitions ====
See the [[#Nesting_Rules|Nesting Rules]] section above for placement of these elements.
 
===== Feed =====
* an XHTML Feed element is identified by <code>class="feed"</code>
* a Feed element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.1.1 atom feed]
: ''In particular, as a container for Entrys.''
* the Feed element is required, even if there is a single Entry
: ''This is for disambiguation''
* hAtom documents MAY have multiple, non-nested Feed elements
: ''This may happen on news pages, or weblogs with "mini-blogs" on the sidebar.''


===== Entry =====
===== Entry Category =====
* an Entry element is identified by <code>class="entry"</code>
* an Entry Category element is identified by [[rel-tag]]
* an Entry element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.1.2 atom entry]
* an Entry {{may}} have an Entry Category
* a weblog entry MUST be enclosed in a single Entry element
* an Entry Category element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.2 Atom category] inside an [http://www.atomenabled.org/developers/syndication/#optionalEntryElements entry]
: ''That's what it's for, after all.''
* the [[rel-tag]] <code>href</code> encodes the atom <code>category:term</code>; the link text defines the atom <code>category:label</code>
* an Entry MUST have an enclosing Feed element
* ''This enclosing element can be the same as the Entry -- i.e. class="feed entry" is OK for feeds with a single entry.''


===== Entry Title =====
===== Entry Title =====
* an Entry Title element is identified <code>&lt;h#></code> in block elements OR non-preferentially <code>class="title"</code> in inline elements
* an Entry Title element is identified by the class name <code>entry-title</code>
* an Entry Title element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.14 atom entry title]
* an Entry {{should}} have an Entry Title
 
* an Entry Title element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.14 Atom entry title]
====== Disambiguation ======
* if the Entry Title is missing, use
 
** the first <code>&lt;h#></code> element in the Entry, or
* the first hAtom valid <code>&lt;h#></code> element to appear in an hAtom document is the Entry Title
** the <code>&lt;title></code> of the page, if there is no enclosing Feed element, or
* otherwise, the first hAtom valid non-<code>&lt;abbr></code> element with a <code>class="title"</code> is the Entry Title
** assume it is the empty string
: ''hAtom valid meaning somewhere where we expect it (like not inside Entry Content, for example).''
* otherwise, the Entry Title is the empty string
: ''Atom does not allow for an entry not to have a title.''


===== Entry Content =====
===== Entry Content =====
* an Entry Content element is identified by <code>class="content"</code>
* an Entry Content element is identified by class name <code>entry-content</code>
* an Entry Content element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#atomContent atom content]
* an Entry {{should}} have Entry Content
* an Entry MAY have 0 or more Entry Content elements
* an Entry Content element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#atomContent Atom content]
: ''We recognize this varies from the Atom spec: see the next rule.''
* 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
* the "logical Entry Content" of an Entry is the concatenation, in order of appearance, of all the Entry Contents within the Entry
: ''Many web logs split content into multiple sections with a "Read More" link and JavaScript tricks. This is also needed in cases where Entry Titles are coded in-line and are considered part of the content.''
: ''Many weblogs split content into multiple sections with a "Read More" link and javascript tricks. This is also needed in cases where Entry Titles are coded inline and are considered part of the content.''
* if the Entry Content is missing, assume it is the empty string
* the "logical Entry Content" MUST be complete; that is, contain the entire content of the Entry
: ''Otherwise it should be marked as Entry Summary.''


===== Entry Summary =====
===== Entry Summary =====
* an Entry Summary element is identified by <code>class="summary"</code>
* an Entry Summary element is identified by class name <code>entry-summary</code>
* an Entry Summary element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.13 atom summary]
* an Entry Summary element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.13 Atom summary]
* an Entry MAY have 0 or more Entry Summary elements
* 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
: ''We recognize this varies from the Atom spec: see the next rule.''
* the "logical Entry Summary" of an Entry is the concatenation, in order of appearance, of all the Entry Summarys within the Entry
* the "logical Entry Summary" may differ in different copies of the Entry
: ''There is the major difference with Entry Content. We can summarize an Entry in different way in different places with no requirement for consistency. There may be issues with this for modelers: if so, take it up in [[hatom-issues]].''


===== Entry Permalink =====
===== Entry Permalink =====
* 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 [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.7 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 Permalink element is identified by <code>rel="bookmark"</code>
===== Entry Updated =====
: ''We recognize that we have broken from Atom terminology at this point. See [[hatom-issues]] for discussion.''
* an Entry Updated element is identified by class name <code>updated</code>
: ''This may be a microformat in itself: [[rel-bookmark]].''
* an Entry Updated element represents the concept of [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.15 Atom updated]
* an Entry Permalink element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.7 atom link in an entry]
* an Entry {{should}} have an Entry Updated element
* Entry Permalinks MUST be absolute URIs
* use the [[value-class-pattern#Date_and_time_parsing|value class pattern date and time]] to encode the updated datetime
* Entry Permalinks MUST be the same as the <code>atom:link</code> (or <code>rss:link</code>) used in syndication feeds
* if there is no Entry Updated element,
: ''The intention of the previous two rules to gently force people to use strings that can be byte compared for equivalence. In general, the canonical URI should be the link used in an Atom entry.''
** use the Entry Published element, if present
: ''Is there a problem with FeedBurner?''
** otherwise the page is invalid hAtom
* if an Entry has multiple elements marked as the Entry Permalink, they MUST have exactly the same URI
* an Entry SHOULD have an Entry Permalink
: ''There are circumstances (such as media pages) where this won't happen. See the next rule.''
* there can be at most 1 Entry in an XHTML document without an Entry Permalink; the Entry Permalink of this Entry is the URI of the page
: ''This rule is needed for media pages (i.e. a news article on cnn.com). There is some ugliness of with this because the URI could be non-canonical.''
 
====== Disambiguation ======
 
* The first valid element in an Entry marked as an Entry Permalink is the Entry Permalink


===== Entry Published =====
===== Entry Published =====
 
* an Entry Published element is identified by the class name <code>published</code>
* an Entry Published element is identified by <code>class="published"</code>
* an Entry Published element represents the concept of [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.9 Atom published]
* a Entry Published element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.9 atom published]
* use the [[value-class-pattern#Date_and_time_parsing|value class pattern date and time]] to encode the published datetime
* the machine readable datetime should be encoded with an <code>&lt;abbr></code> element using the [[datetime-design-pattern]]; the machine readable datetime should be complete, that is, specified to the second with the timezone included
 
====== Disambiguation ======
 
* The first valid element in an Entry marked as an Entry Published is the Entry Published element


===== Entry Author =====
===== Entry Author =====
 
* an Entry Author element is represented by class name <code>author</code>
* an Entry Author element is identified by an XHTML <code>&lt;address></code> element
* an Entry Author element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.1 Atom author]
* an Entry Author element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.1 atom author]
* an Entry Author element {{must}} be encoded in an [[hcard|hCard]]
* an Entry Author element SHOULD contain an [[hcard|hCard]]
* an Entry Author element {{should}} be encoded in an <code>&lt;address></code> element
* an Entry Author element MAY add <code>class="author"</code>
* an Entry {{should}} have at least one Entry Author element
: ''Atom defines other levels of "person", such as "contributor"''
* an Entry {{may}} have more than one Entry Author elements
* an Entry MAY have 0 or more Entry Author elements
* if the Entry Author is missing
* if an Entry has 0 Entry Athor elements, the "logical Entry Author" is assumed to be the author of the XHTML page
** find the [[algorithm-nearest-in-parent|Nearest In Parent]] <code>&lt;address></code> element(s) with class name <code>author</code> and that is/are a valid [[hcard|hCard]]
: ''Atom requires at least one Author''
** otherwise the entry is invalid hAtom
 
===== Entry Contibutor =====
 
* an Entry Contibutor element is identified by an XHTML <code>&lt;address class="contributor"></code> element
* an Entry Contibutor element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.3 atom contributor]
* an Entry Contibutor element SHOULD contain an [[hcard|hCard]]
* an Entry MAY have 0 or more Entry Contibutor elements


=== XMDP Profile ===
=== XMDP Profile ===
<pre>
See [[hatom-profile]].
<dl class="profile">
<dt>class</dt>
<dd><p>
  <a rel="help" href="http://www.w3.org/TR/html401/struct/global.html#adef-class">
  HTML4 definition of the 'class' attribute.</a>
  This meta data profile defines some 'class' attribute values (class names)
  and their meanings as suggested by a
  <a href="http://www.w3.org/TR/WD-htmllink-970328#profile">
  draft of "Hypertext Links in HTML"</a>.
  <dl>
  <dt>feed</dt>
  <dd>
    The concept of atom:feed from
    <a href="http://www.atomenabled.org/developers/syndication/atom-format-spec.php">The Atom Syndication Format</a>,
    constrained and modified as per the <a href="http://microformats.org/wiki/hatom">hAtom microformat spec</a>.
  </dd>
  <dt>entry</dt>
  <dd>
    The concept of atom:entry from
    <a href="http://www.atomenabled.org/developers/syndication/atom-format-spec.php">The Atom Syndication Format</a>,
    constrained and modified as per the <a href="http://microformats.org/wiki/hatom">hAtom microformat spec</a>.
  </dd>
  <dt>content</dt>
  <dd>
    The concept of atom:content from
    <a href="http://www.atomenabled.org/developers/syndication/atom-format-spec.php">The Atom Syndication Format</a>,
    constrained and modified as per the <a href="http://microformats.org/wiki/hatom">hAtom microformat spec</a>.
  </dd>
  <dt>summary</dt>
  <dd>
    The concept of atom:summary from
    <a href="http://www.atomenabled.org/developers/syndication/atom-format-spec.php">The Atom Syndication Format</a>,
    constrained and modified as per the <a href="http://microformats.org/wiki/hatom">hAtom microformat spec</a>.
  </dd>
  <dt>bookmark</dt>
  <dd>
    The concept of atom:link (without any "rel") with an atom:entry from
    <a href="http://www.atomenabled.org/developers/syndication/atom-format-spec.php">The Atom Syndication Format</a>,
    constrained and modified as per the <a href="http://microformats.org/wiki/hatom">hAtom microformat spec</a>.
  </dd>
  <dt>published</dt>
  <dd>
    The concept of atom:published from
    <a href="http://www.atomenabled.org/developers/syndication/atom-format-spec.php">The Atom Syndication Format</a>,
    constrained and modified as per the <a href="http://microformats.org/wiki/hatom">hAtom microformat spec</a>.
  </dd>
  <dt>author</dt>
  <dd>
    The concept of atom:author from
    <a href="http://www.atomenabled.org/developers/syndication/atom-format-spec.php">The Atom Syndication Format</a>,
    constrained and modified as per the <a href="http://microformats.org/wiki/hatom">hAtom microformat spec</a>.
  </dd>
  </dl>
</dd>
</dl>
</pre>
 
=== Parsing Details ===


== Examples ==
== Examples ==


This section is informative.
See [[hatom-examples]].


=== Transformation 1 ===
=== Examples in the wild ===


A well behaved weblog.
See [[hatom-examples-in-wild]].


Original:
== Implementations ==


<pre><nowiki>
See [[hatom-implementations]].
<body>
<div id="wrap">
  <div id="content">
  ...
  <div class="entry">
    <h3 id="post-60">
    <a href="http://www.microformats.org/blog/..." rel="bookmark" title="...">Wiki Attack</a>
    </h3>
    <p>We had a bit of trouble with ...</p>
    <p>We&#8217;ve restored the wiki and ...</p>
    <p>If anyone is working to combat said spammers ...</p>


    <h4 class="tags">Technorati Tags:</h4>
== Copyright ==
    <ul class="tags">
{{MicroFormatCopyrightStatement2005}}
    <li><a href="http://technorati.com/tag/mediawiki" rel="tag">mediawiki</a></li>
* [[User:Tantek|Tantek]]: I release all my contributions to this specification into the public domain and I encourage the other authors to do so as well.
    <li><a href="http://technorati.com/tag/microformats" rel="tag">microformats</a></li>
** When all authors/editors have done so, we can remove the MicroFormatCopyrightStatement template reference and replace it with the MicroFormatPublicDomainContributionStatement.
    <li><a href="http://technorati.com/tag/spam" rel="tag">spam</a></li>
    </ul>


    <ul class="post-info">
== Patents ==
    <li>
{{MicroFormatPatentStatement}}
      <a href="http://www.microformats.org/blog/..." rel="bookmark" title="...">October 10th, 2005</a>
    </li>
    <li>
      <address class="vcard"><a class="url fn" href="http://theryanking.com">Ryan King</a></address>
    </li>
    <li>
      <a href="http://www.microformats.org/blog/...">4 Comments</a>
    </li>
    </ul>
  </div>
 
  <div class="entry">
  ....
  </div>
  ...
  </div>
</div>
</body>
</nowiki></pre>
 
Transformed to hAtom compliant (shown in UPPER CASE for visibility only):
 
<pre><nowiki>
<body>
<div id="wrap">
  <div id="FEED content">
  ...
  <div class="entry" ID="post-60">
    <h3>
    <a href="http://www.microformats.org/blog/..." rel="bookmark" title="...">Wiki Attack</a>
    </h3>
    <DIV CLASS="CONTENT">
    <p>We had a bit of trouble with ...</p>
    <p>We&#8217;ve restored the wiki and ...</p>
    <p>If anyone is working to combat said spammers ...</p>
    </DIV>
 
    <h4 class="tags">Technorati Tags:</h4>
    <ul class="tags">
    <li><a href="http://technorati.com/tag/mediawiki" rel="tag">mediawiki</a></li>
    <li><a href="http://technorati.com/tag/microformats" rel="tag">microformats</a></li>
    <li><a href="http://technorati.com/tag/spam" rel="tag">spam</a></li>
    </ul>
 
    <ul class="post-info">
    <li>
      <a href="http://www.microformats.org/blog/..." rel="bookmark"
        title="..."><ABBR CLASS="PUBLISHED" TITLE="20051010T14:07:00-0700">October 10th, 2005</ABBR></a>
    </li>
    <li>
      <address class="vcard"><a class="url fn" href="http://theryanking.com">Ryan King</a></address>
    </li>
    <li>
      <a href="http://www.microformats.org/blog/...">4 Comments</a>
    </li>
    </ul>
  </div>
 
  <div class="entry" ID="post-59">
  ....
  </div>
  ...
  </div>
</div>
</body>
</nowiki></pre>
 
Changes:
* Added <code>class="feed"</code> to Feed
* Moved <code>id="###"</code> from <code>&lt;h3></code> to Entry
* Added <code>&lt;div class="content"></code>...<code>&lt;/div></code> around the Entry Content
* Added <code>&lt;abbr class="PUBLISHED" title="YYYYMMDDThh:mm:ss+ZZZZ"></code>...<code>&lt;/abbr></code> around the Entry Datetime
 
Also note:
* We did not need to add a <code>class="entry"</code> to each Entry
* We did not need to add a <code>&lt;address></code> element
* We did not need to add a <code>&lt;h#></code> element
* We did not need to add a <code>rel="bookmark"</code> to Entry Permalinks
 
=== Transformation 2 ===
 
A not-so well behaved weblog (an older blogspot weblog)
 
Original:
 
<pre><nowiki>
<body bgcolor="...">
 
<div class="posts">
  <a name="112993192128302715">&nbsp;</a><br>
  <div style="clear:both;"></div><strong>Nelson's final prayer</strong>
  written on the night before Trafalgar:<blockquote>May the Great God, ... heart.
  <div style="clear:both; padding-bottom: 0.25em;"></div>
  <br>
  <span class="byline">
  posted by Natalie at
  <a href="2005_10_16_nataliesolent_archive.html#112993192128302715">9:49 PM</a>
  </span>
</div>
 
<div class="posts">
  <a name="112993022840118939">&nbsp;</a>
  <br>
  <div style="clear:both;"></div><strong>I really, truly </strong>didn't go ... view.
  <div style="clear:both; padding-bottom: 0.25em;"></div>
  <br>
  <span class="byline">
  posted by Natalie at
  <a href="2005_10_16_nataliesolent_archive.html#112993022840118939">9:28 PM</a>
  </span>
</div>
...
 
</body>
</nowiki></pre>
 
Transformed to hAtom compliant (shown in UPPER CASE for visibility only):
 
<pre><nowiki>
<body bgcolor="...">
 
<DIV CLASS="FEED">
  <div class="ENTRY posts" ID="112993192128302715">
  <strong CLASS="TITLE CONTENT">
    Nelson's final prayer
  </strong>
  <SPAN CLASS="CONTENT">
    written on the night before Trafalgar:<blockquote>May the Great God, ... heart.
  </SPAN>
  <DIV>
    <span class="byline">posted by <address>Natalie</address> at
    <a REL="BOOKMARK" href="HTTP://NATALIESOLENT.BLOGSPOT.COM/2005_10_16_nataliesolent_archive.html#112993192128302715">
    <ABBR CLASS="POSTED" TITLE="20051024T094900-0000">9:49 PM</ABBR></a>
    </span>
  </DIV>
  </div>
 
  <div class="ENTRY posts" ID="112993022840118939">
  <strong CLASS="TITLE CONTENT">I really, truly </strong>
  <SPAN CLASS="CONTENT">
    didn't go ... view.
  </SPAN>
  <DIV>
    <span class="byline">
    posted by <address>Natalie</address> at
    <a REL="BOOKMARK" href="HTTP://NATALIESOLENT.BLOGSPOT.COM/2005_10_16_nataliesolent_archive.html#112993022840118939">
    <ABBR CLASS="POSTED" TITLE="20051024T094900-0000">9:28 PM</ABBR></a>
    </span>
  </DIV>
  </div>
...
</DIV>
 
</body>
</nowiki></pre>
 
Changes:
* Added <code>class="feed"</code> to Feed
* Added <code>class="entry"</code> to each Entry
* Moved <code>id="###"</code> up to the Entry (and deleted the empty anchor block)
* Added <code>rel="bookmark"</code> to the Entry Permalinks
* Made the Entry Permalink non-relative
* Added <code>&lt;span class="title"></code>...<code>&lt;/div></code> around the Entry Title
* Added <code>&lt;span class="content"></code>...<code>&lt;/div></code> around the Entry Title (!)
* Added <code>&lt;span class="content"></code>...<code>&lt;/div></code> around the Entry Content
* Added <code>&lt;abbr class="posted" title="YYYYMMDDThh:mm:ss+ZZZZ"></code>...<code>&lt;/abbr></code> around the Entry Datetime
* Added <code>&lt;address></code> to the poster's name
 
Also note:
* there are multiple content blocks, because Natalie Solent embeds the title in the content
* cleaned up lots of crap HTML presentation stuff, with the assumption it would be fixed in the stylesheet
* this is one of the uglier transformations you're likely to see
* we've respected the poster's poster apparent wish for anonimity by not adding an hCard
 
=== Transformation 3 ===


A media page (from [http://www.cbc.ca/story/world/national/2005/11/22/birdlfu051122.html CBC Newsworld]).
== Semantic HTML Design Principles ==
 
<div id="Semantic_XHTML_Design_Principles">{{semantic-html-design-principles}}</div>
Original:
 
<pre><nowiki>
<div class="news">
<div class="story">
  <h1>China confirms new bird flu outbreaks</h1>
  <span class="byline">Last Updated Tue, 22 Nov 2005 23:26:18 EST</span>
  <div class="text"><a href="/news/credit.html">CBC News</a></div>
 
  <div class="text">
  <p>
  China has confirmed three new outbreaks of bird flu, ...
  <p>
    <ul>
    <li><font SIZE="1">INDEPTH: </font><font SIZE="2">
    <a href="http://www.cbc.ca/news/background/avianflu/">Avian Flu</a></font>
    </ul>
  </p>
  <table align="right" cellpadding="0" cellspacing="4" hspace="4" width="220">
    <tr>
    <td align="center">
    <img src="http://www.cbc.ca/gfx/pix/birdflu_china_cp_7707271.jpg" width="220" height="223" hspace="3" border="0">
    </td>
    </tr>
    <tr>
    <td align="center">
    <div class="caption">
    <font size="1" face="verdana,arial"><i></i></font>
    </div>
    </td>
    </tr>
  </table>
  <p>State media says the new outbreaks are in...</p>
  <p>The news comes a day after China announced the ...</p>
  <p>In China's eastern Anhui province, authorities have ...</p>
  <p>The province says the measure will prevent domestic ...</p>
  <p>Vietnamese health officials have confirmed that a  ...</p>
  <p>Doctors from the health department in the northern  ...</p>
  <p>Bird flu has killed 42 people in Vietnam since December  ...</p>
  <p>The World Health Organization fears the H5N1 strain of  ...</p>
  </div>
 
  <p><font face="Verdana,Arial" size="1">with files from the Australian Broadcasting Corporation</font></p>
</div>
...
</div>
</nowiki></pre>
 
Transformed to hAtom compliant (shown in UPPER CASE for visibility only):
 
<pre><nowiki>
<div class="news">
<div class="FEED ENTRY story">
  <h1>China confirms new bird flu outbreaks</h1>
  <span class="byline">Last Updated
  <ABBR CLASS="POSTED" TITLE="20051123T042618Z">Tue, 22 Nov 2005 23:26:18 EST</ABBR>
  </span>
  <ADDRESS CLASS="VCARD"><div class="text"><a CLASS="URL" href="/news/credit.html">CBC News</a></div></ADDRESS>
 
  <div class="text">
  <p CLASS="CONTENT">
  China has confirmed three new outbreaks of bird flu, ...
  </p>
  <p>
    <ul>
    <li><font SIZE="1">INDEPTH: </font><font SIZE="2">
    <a href="http://www.cbc.ca/news/background/avianflu/">Avian Flu</a></font>
    </ul>
  </p>
  <table align="right" cellpadding="0" cellspacing="4" hspace="4" width="220">
    <tr>
    <td align="center">
    <img src="http://www.cbc.ca/gfx/pix/birdflu_china_cp_7707271.jpg" width="220" height="223" hspace="3" border="0">
    </td>
    </tr>
    <tr>
    <td align="center">
    <div class="caption">
    <font size="1" face="verdana,arial"><i></i></font>
    </div>
    </td>
    </tr>
  </table>
  <p CLASS="CONTENT">State media says the new outbreaks are in...</p>
  <p CLASS="CONTENT">The news comes a day after China announced the ...</p>
  <p CLASS="CONTENT">In China's eastern Anhui province, authorities have ...</p>
  <p CLASS="CONTENT">The province says the measure will prevent domestic ...</p>
  <p CLASS="CONTENT">Vietnamese health officials have confirmed that a  ...</p>
  <p CLASS="CONTENT">Doctors from the health department in the northern  ...</p>
  <p CLASS="CONTENT">Bird flu has killed 42 people in Vietnam since December  ...</p>
  <p CLASS="CONTENT">The World Health Organization fears the H5N1 strain of  ...</p>
  </div>
 
  <p><font face="Verdana,Arial" size="1">with files from the <ADDRESS CLASS="CONTRIBUTOR">Australian Broadcasting Corporation</ADDRESS></font></p>
</div>
...
</div>
</nowiki></pre>
 
Changes:
* Added <code>&lt;div class="feed entry"></code> around the single entry on the page
: ''We have to make sure the nesting rules reflect nesting at the same level''
* Added <code>&lt;span class="content"></code>...<code>&lt;/div></code> around every single paragraph -- this looks pathological but it may be the way this would need be produced from a template. The latter part of the document could be enclosed in a single "content" div but note that we did this so the "INDEPTH" part would not be marked as content,
* Added <code>&lt;abbr class="posted" title="YYYYMMDDThh:mm:ss+ZZZZ"></code>...<code>&lt;/abbr></code> around the Entry Datetime
* Added <code>&lt;address></code> to the CBC Newsroom
* Added <code>&lt;address class="contributor"></code> to a contributor's name
 
Also note:
* We may the document more XHTML compliant
* There is no <code>rel="bookmark"</code> so it is assumed to be the URI of the page
* The Entry Title was correctly marked with a <code>&lt;h1></code> element
 
=== Transformation 4 ===
 
A bulletin board ([http://forums.punbb.org/viewtopic.php?id=9135 PunBB])
 
Original:
 
<pre><nowiki>
<body>
<div id="punwrap">
  <div id="punviewtopic" class="pun">
 
  <div id="brdheader" class="block">
    ... header stuff ...
  </div>
 
  <div id="announce" class="block">
    ... announcement stuff ...
  </div>
 
  <div class="linkst">
    ... controls for the blog
  </div>
 
  <div id="p54390" class="blockpost rowodd firstpost">
    <h2>
    <span><span class="conr">#1&nbsp;</span>
    <a href="viewtopic.php?pid=54390#p54390">2005-10-16 10:36:24</a></span>
    </h2>
    <div class="box">
    <div class="inbox">
      <div class="postleft">
      <dl>
        <dt><strong><a href="profile.php?id=2">Rickard</a></strong></dt>
 
        <dd class="usertitle"><strong>PunBB Developer</strong></dd>
        <dd class="postavatar"><img src="img/avatars/2.png" width="60" height="60" alt="" /></dd>
        <dd>From: 127.0.0.1</dd>
        <dd>Registered: 2001-11-02</dd>
        <dd>Posts: 7806</dd>
        <dd class="usercontacts"><a href="http://www.punbb.org/">Website</a></dd>
 
      </dl>
      </div>
      <div class="postright">
      <h3>PunBB 1.2.9</h3>
      <div class="postmsg">
        <p>Just a quick note this time....</p>
 
      </div>
      <div class="postsignature"><hr />&quot;Programming is like sex: ...</div>
      </div>
      <div class="clearer"></div>
      <div class="postfootleft"><p>Offline</p></div>
      <div class="postfootright"><div>&nbsp;</div></div>
    </div>
    </div>
 
  </div>
 
  <div id="p54392" class="blockpost roweven">
    <h2><span><span class="conr">#2&nbsp;</span><a href="viewtopic.php?pid=54392#p54392">2005-10-16 10:54:41</a></span></h2>
    <div class="box">
    <div class="inbox">
      <div class="postleft">
      <dl>
        <dt><strong><a href="profile.php?id=5298">IdleFire</a></strong></dt>
 
        <dd class="usertitle"><strong>Member</strong></dd>
        <dd class="postavatar"></dd>
        <dd>Registered: 2005-10-14</dd>
        <dd>Posts: 27</dd>
      </dl>
      </div>
      <div class="postright">
 
      <h3> Re: PunBB 1.2.9</h3>
      <div class="postmsg">
        <p>...</p>
      </div>
      </div>
      <div class="clearer"></div>
      <div class="postfootleft"><p>Offline</p></div>
 
      <div class="postfootright"><div>&nbsp;</div></div>
    </div>
    </div>
  </div>
 
  ... more entries ...
 
  <div id="brdfooter" class="block">
    ... footer stuff ...
  </div>
 
  </div>
</div>
</body>
</nowiki></pre>
 
Transformed to hAtom compliant (changes shown in UPPER CASE for visibility only):
 
<pre><nowiki>
<body>
<div id="punwrap">
  <div id="punviewtopic" class="pun">
 
  <div id="brdheader" class="block">
    ... header stuff ...
  </div>
 
  <div id="announce" class="block">
    ... announcement stuff ...
  </div>
 
  <div class="linkst">
    ... controls for the blog
  </div>
 
  <DIV CLASS="FEED">
  <div id="p54390" class="ENTRY blockpost rowodd firstpost">
    <h2>
    <span><span class="conr">#1&nbsp;</span>
    <a REL="BOOKMARK" href="HTTP://FORUMS.PUNBB.ORG/viewtopic.php?pid=54390#p54390">
      <ABBR CLASS="POSTED" TITLE="20051016T103624-0500">2005-10-16 10:36:24</ABBR>
    </a></span>
    </h2>
    <div class="box">
    <div class="inbox">
      <div class="postleft">
      <dl>
        <dt><strong><ADDRESS><a href="profile.php?id=2">Rickard</a></ADDRESS></strong></dt>
 
        <dd class="usertitle"><strong>PunBB Developer</strong></dd>
        <dd class="postavatar"><img src="img/avatars/2.png" width="60" height="60" alt="" /></dd>
        <dd>From: 127.0.0.1</dd>
        <dd>Registered: 2001-11-02</dd>
        <dd>Posts: 7806</dd>
        <dd class="usercontacts"><a href="http://www.punbb.org/">Website</a></dd>
 
      </dl>
      </div>
      <div class="postright">
      <h3>PunBB 1.2.9</h3>
      <div class="CONTENT postmsg">
        <p>Just a quick note this time....</p>
 
      </div>
      <div class="postsignature"><hr />&quot;Programming is like sex: ...</div>
      </div>
      <div class="clearer"></div>
      <div class="postfootleft"><p>Offline</p></div>
      <div class="postfootright"><div>&nbsp;</div></div>
    </div>
    </div>
 
  </div>
 
  <div id="p54392" class="ENTRY blockpost roweven">
    <h2>
    <span><span class="conr">#2&nbsp;</span>
    <a REL="BOOKMARK" href="HTTP://FORUMS.PUNBB.ORG/viewtopic.php?pid=54392#p54392">
      <ABBR CLASS="POSTED" TITLE="20051016T1105441-0500">2005-10-16 10:54:41</ABBR>
    </a></span>
    </h2>
    <div class="box">
    <div class="inbox">
      <div class="postleft">
      <dl>
        <dt><strong><ADDRESS CLASS="VCARD"><a CLASS="URL" href="profile.php?id=5298">IdleFire</a></ADDRESS></strong></dt>
 
        <dd class="usertitle"><strong>Member</strong></dd>
        <dd class="postavatar"></dd>
        <dd>Registered: 2005-10-14</dd>
        <dd>Posts: 27</dd>
      </dl>
      </div>
      <div class="postright">
 
      <h3> Re: PunBB 1.2.9</h3>
      <div class="CONTENT postmsg">
        <p>...</p>
      </div>
      </div>
      <div class="clearer"></div>
      <div class="postfootleft"><p>Offline</p></div>
 
      <div class="postfootright"><div>&nbsp;</div></div>
    </div>
    </div>
  </div>
 
  ... more entries ...
  </DIV>
 
  <div id="brdfooter" class="block">
    ... footer stuff ...
  </div>
 
  </div>
</div>
</body>
</nowiki></pre>
 
 
Changes:
* Added <code>&lt;div class="feed"></code> around the entries (as opposed to an existing <code>&lt;div</code> that enclosed more than entries.
* Added <code>class="entry"</code> to each Entry
* Added <code>rel="bookmark"</code> to the Entry Permalinks
* Made the Entry Permalink non-relative
* Added <code>&lt;span class="title"></code>...<code>&lt;/div></code> around the Entry Title
* Added <code>&lt;span class="content"></code>...<code>&lt;/div></code> around the Entry Content
* Added <code>&lt;abbr class="posted" title="YYYYMMDDThh:mm:ss+ZZZZ"></code>...<code>&lt;/abbr></code> around the Entry Datetime
* Added <code>&lt;address></code> to the poster's name
 
Also note:
* We did not need to add <code>id="###"</code> to the Entry
 
=== More Examples ===
 
See [[hatom-examples]].
 
== Examples in the wild ==
This section is '''informative'''.
 
== Implementations ==
This section is '''informative'''.


== References ==
== References ==
=== Normative References ===
=== Normative References ===
* [http://www.w3.org/TR/2002/REC-xhtml1-20020801/ XHTML 1.0 SE]
* [http://www.w3.org/TR/2002/REC-xhtml1-20020801/ XHTML 1.0 SE]
* [http://www.atomenabled.org/ Atom]
* [http://www.ietf.org/rfc/rfc4287 RFC4287: The Atom Syndication Format]
* [[hcard-parsing]]
* [[rfc-2119|RFC 2119]]
* [[iso-8601|ISO8601]]


=== Informative References ===
=== Informative References ===
* [http://www.atomenabled.org/ atomenabled.org]


==== Specifications That Use hAtom ====
== Further Reading ==
 
* [http://www.ablognotlimited.com/articles/getting-semantic-with-microformats-part-5-hatom/ Getting Semantic With Microformats, Part 5: hAtom] by [http://www.ablognotlimited.com/ Emily Lewis]
==== Similar Work ====
 
* [http://rdfs.org/sioc/ Semantically-Interlinked Online Communities (SIOC) RDF Ontology]


== Work in progress ==
== Work in progress ==
Line 899: Line 208:
* [[blog-post-brainstorming|blog-post Brainstorming]]
* [[blog-post-brainstorming|blog-post Brainstorming]]


== Hints and Tips ==
=== Version 0.1 ===


=== CSS tips ===
Version 0.1 was released 28 February 2006.
HTML typically styles <code>address</code> as a block level element in an italic font. This will make it inline and plain:
 
<pre><nowiki>
address {
    display: inline;
    font-weight: normal;
    font-style: normal;
}
</nowiki></pre>


== Discussions ==
== Discussions ==
Line 920: Line 220:


=== Issues ===
=== Issues ===
* Please add any issues with the specification to the separate [[htom-issues|hAtom issues]] document.
* Please add any issues with the specification to the separate [[hatom-issues|hAtom issues]] document.


==See Also==
==See Also==
* [[hatom|hAtom]] - the draft proposal
{{hatom-related-pages}}
* [[hatom-issues]] - problems? complaints? ideas? Put them here
* [[rel-enclosure]] - how to semantically reference enclosures (e.g. podcasts) in hAtom
* [[hatom-faq]] - knowledge base
* [[blog-post-brainstorming]]
* [[blog-post-brainstorming]]
* [[blog-post-formats]]
* [[blog-post-formats]]
* [[blog-post-examples]]
* [[blog-post-examples]]
* [[blog-post-feed-equivalence]]
* [[blog-description-format]] - how to describe a blog (as opposed to the individual entries, which is what we're doing here)
* [[blog-description-format]] - how to describe a blog (as opposed to the individual entries, which is what we're doing here)
* [[xhtml-syndication]]
[[Category:Draft Specifications]]
[[Category:hAtom]]
== Translations ==
Read the hAtom draft specification in additional <span id="languages">languages</span>:
* [[hatom-fr|français]]

Latest revision as of 23:32, 20 June 2024

See latest version: h-entry

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 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.

Draft Specification

Editor/Author
David Janes (BlogMatrix, Inc.)
Contributors
Benjamin Carlyle
Tantek Çelik (http://tantek.com/ and before at Technorati, Inc.)

copyright and patents statements apply.

Status

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.

Available languages

The English version of this specification is the only normative version. For translations of this document see the #translations section.

Errata and Updates

Known errors and issues in this specification are corrected in resolved and closed issues. Please check there before reporting issues.

The hAtom 0.2 update is currently under development and incorporates known errata corrections as well as the value-class-pattern.

Introduction

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.

Example

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>
  
  <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>

Get started

The class hentry is a root class name that indicates the presence of an hAtom entry.

entry-title, author, published, entry-summary, entry-content and the other hAtom property classnames listed below define properties of the entry.

Format

In General

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

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:

[*] Some required elements have defaults if missing, see below.

Field and Element Details

Feed
  • a Feed element is identified by the class name hfeed
  • 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
Feed Category
  • 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 href encodes the atom category:term; the link text defines the atom category:label
Entry
  • an Entry element is identified by class name hentry
  • an Entry element represents the concept of an Atom entry
  • any microformat content inside a <blockquote> or <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
Entry Category
  • 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 href encodes the atom category:term; the link text defines the atom category:label
Entry Title
  • an Entry Title element is identified by the class name entry-title
  • 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
    • the <title> of the page, if there is no enclosing Feed element, or
    • assume it is the empty string
Entry Content
  • an Entry Content element is identified by class name entry-content
  • 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
Many web logs split content into multiple sections with a "Read More" link and JavaScript tricks. This is also needed in cases where Entry Titles are coded in-line and are considered part of the content.
  • if the Entry Content is missing, assume it is the empty string
Entry Summary
  • an Entry Summary element is identified by class name entry-summary
  • 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
Entry Permalink
  • 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
Entry Updated
  • an Entry Updated element is identified by class name updated
  • 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
Entry Published
Entry Author
  • an Entry Author element is represented by class name author
  • 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 <address> element
  • 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
    • find the Nearest In Parent <address> element(s) with class name author and that is/are a valid hCard
    • otherwise the entry is invalid hAtom

XMDP Profile

See hatom-profile.

Examples

See hatom-examples.

Examples in the wild

See hatom-examples-in-wild.

Implementations

See hatom-implementations.

Copyright

This specification is (C) 2005-2024 by the authors. However, the authors intend to submit (or already have submitted, see details in the spec) 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.

Patents

This specification is subject to a royalty free patent policy, e.g. per the W3C Patent Policy, and IETF RFC3667 & RFC3668.

Semantic HTML Design Principles

  1. Reuse the schema (names, objects, properties, values, types, hierarchies, constraints) as much as possible from pre-existing, established, well-supported microformats.
  2. 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.
    1. For types with multiple components, use nested elements with class names equivalent to the names of the components.
    2. Plural components are made singular, and thus multiple nested elements are used to represent multiple text values that are comma-delimited.
  3. Use the most accurately precise semantic HTML building block for each object etc.
  4. Otherwise use a generic structural element (e.g. <span> or <div>), or the appropriate contextual element (e.g. an <li> inside a <ul> or <ol>).
  5. 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.
  6. 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.

References

Normative References

Informative References

Further Reading

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

Version 0.1 was released 28 February 2006.

Discussions

Q&A

  • If you have any questions about hAtom, check the hAtom FAQ, and if you don't find answers, add your questions!

Issues

  • Please add any issues with the specification to the separate hAtom issues document.

See Also

Translations

Read the hAtom draft specification in additional languages: