hatom: Difference between revisions
DavidJanes (talk | contribs) |
DavidJanes (talk | contribs) |
||
Line 140: | Line 140: | ||
constrained and modified as per the <a href="http://microformats.org/wiki/hatom">hAtom microformat spec</a>. | constrained and modified as per the <a href="http://microformats.org/wiki/hatom">hAtom microformat spec</a>. | ||
</dd> | </dd> | ||
<dt>content</dt> | <dt>entry-title</dt> | ||
<dd> | |||
The concept of atom:title inside of 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>entry-content</dt> | |||
<dd> | <dd> | ||
The concept of atom:content from | The concept of atom:content from | ||
Line 146: | Line 152: | ||
constrained and modified as per the <a href="http://microformats.org/wiki/hatom">hAtom microformat spec</a>. | constrained and modified as per the <a href="http://microformats.org/wiki/hatom">hAtom microformat spec</a>. | ||
</dd> | </dd> | ||
<dt> | <dt>entry-summary</dt> | ||
<dd> | <dd> | ||
The concept of atom:summary from | The concept of atom:summary from | ||
Line 180: | Line 186: | ||
</dl> | </dl> | ||
</pre> | </pre> | ||
== Examples == | == Examples == |
Revision as of 08:47, 23 February 2006
hAtom
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.
This microformat is a draft; please address your concerns, issues, comments, etc. in hatom-issues.
Draft Specification
Editor/Author
Contributors
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.
Patents
This specification is subject to a royalty free patent policy, e.g. per the W3C Patent Policy, and IETF RFC3667 & RFC3668.
Introduction
@TODO - we need an intro here
Semantic XHTML Design Principles
Note: the Semantic XHTML Design Principles were written primarily within the context of developing hCard and hCalendar, thus it may be easier to understand these principles in the context of the hCard design methodology (i.e. read that first). Tantek
XHTML is built on XML, and thus XHTML based formats can be used not only for convenient display presentation, but also for general purpose data exchange. In many ways, XHTML based formats exemplify the best of both HTML and XML worlds. However, when building XHTML based formats, it helps to have a guiding set of principles.
- Reuse the schema (names, objects, properties, values, types, hierarchies, constraints) as much as possible from pre-existing, established, well-supported standards by reference. Avoid restating constraints expressed in the source standard. Informative mentions are ok.
- 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 XHTML building block for each object etc.
- 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>
). - Use class names based on names from the original schema, unless the semantic XHTML 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 and/or not human-friendly, use
<abbr>
instead of a generic structural element, and place the literal data into the 'title' attribute (where abbr expansions go), and the more brief and human readable equivalent into the element itself. Further informative explanation of this use of<abbr>
: Human vs. ISO8601 dates problem solved
Format
In General
The 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.
- 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.
Rules and Definitions
See the Nesting Rules section above for placement of these elements.
Feed
- an Feed element is identified by the
class="hfeed"
- 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, non-nested Feed elements
Entry
- an Entry element is identified by
class="hentry"
- an Entry element represents the concept of an atom entry
Entry Title
- an Entry Title element is identified by the class name
class="entry-title"
- an Entry Title element MAY alternately be identified by the
<h#>
element in an Entry - an Entry Title element represents the concept of an atom entry title
- otherwise the Entry Title is the empty string
Entry Content
- an Entry Content element is identified by
class="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 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.
- 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
- an Entry Summary element is identified by
class="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 Permalink element represents the concept of an atom link in an entry
- an Entry SHOULD have an Entry Permalink
- 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).
Entry Published
- an Entry Published element is identified by the class name
published
- a Entry Published element represents the concept of atom published
- the machine readable datetime should be encoded with an
<abbr>
element using the datetime-design-pattern; the machine readable datetime should be complete, that is, specified to the second with the timezone included
- This is to be consistent with the Atom Datetime Construct.
- optionally, this can be specified by an HTML element with the ISO datetime in the text.
Entry Updated
- an Entry Updated element is identified by
class="updated"
- a Entry Updated element represents the concept of atom updated
- the machine readable datetime should be encoded with an
<abbr>
element using the datetime-design-pattern; the machine readable datetime should be complete, that is, specified to the second with the timezone included
- This is to be consistent with the Atom Datetime Construct.
- if there is no Entry Updated element, the value is assumed to be that of Entry Published
- Entry Published is more often available in weblog templates, so we're going with that.
- if there is no Entry Updated and Entry Published elements, transformation to Atom is problematic
- This is because a published element is required. Suggestions would be appreciated here.
- optionally, this can be specified by an HTML element with the ISO datetime in the text.
- This is a little uglier for the reader, but it's possible.
Entry Author
- an Entry Author element is represented by
class="author"
- an Entry Author element SHOULD use an XHTML
<address>
element - an Entry Author element represents the concept of an atom author
- an Entry Author element SHOULD contain an hCard
- If it does not, just consider the text to effectively be the FN. hReview also considers a hCard to be a SHOULD, not a MUST.
- an Entry MAY have 0 or more Entry Author elements
- if an Entry has 0 Entry Author elements, the "logical Entry Author" is assumed to be the author of the XHTML page
- Atom requires at least one Author
Categories and Tags
This section needs a lot more work.
- Entry categories and tagging are represented by rel-tag
- rel-tag elements may appear anywhere within a Entry, including Entry Content. This is the one case where we break opacity.
XMDP 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>hfeed</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>hentry</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>entry-title</dt> <dd> The concept of atom:title inside of 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>entry-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>entry-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>updated</dt> <dd> The concept of atom:updatedfrom <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>
Examples
See hatom-examples.
Examples in the wild
This section is informative.
- Ranting and Roaring (David Janes)
- Second p0st (Phil Pearson)
- Sound Advice (Benjamin Carlyle)
- Sedna RSS (a feed aggregator based on SPIP, by Fil, IZO and others; GPLd sources are available at SPIP-Zone)
Implementations
This section is informative.
- the Almost Universal Microformat Parser can extract hAtom content from webpages (example)
- the microformat-action Greasemonkey script detects hAtom content on webpages and will call the Almost Universal Microformat Parser
- the hAtom Template Rewriter converts Blogger, MovableType and Wordpress templates into hAtom compatible ones -- (hopefully) without presentation impact
- hAtom2Atom.xsl transforms hAtom to Atom (as the name suggests.)
- There is now an hatom2atom proxy that uses hAtom2Atom.xsl.
References
Normative References
Informative References
Specifications That Use hAtom
Similar Work
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:
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.
Recent Changes
Most recent at top please. This section will eventually be removed but should be helpful for people tracking changes during specing.
- Entry Permalink now SHOULD (as opposed to MUST) be a complete URI
- Entry Title now preferentially uses class="title"
- Entry Author most explicitly be marked class="author"
- using an
<address
around Entry Author and Entry Contributor is no longer required
See Also
- hAtom - the draft proposal
- [[hatom-hints|hAtom Hints] - help for implementors
- hatom-issues - problems? complaints? ideas? Put them here
- hatom-faq - knowledge base
- blog-post-brainstorming
- blog-post-formats
- blog-post-examples
- blog-description-format - how to describe a blog (as opposed to the individual entries, which is what we're doing here)