hatom-hints: Difference between revisions
No edit summary |
m (Reverted edits by LacalBasca (Talk) to last version by AndyMabbett) |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 30: | Line 30: | ||
| Entry Title | | Entry Title | ||
| <code>atom:title</code> | | <code>atom:title</code> | ||
| Add class name <code>headline</code>. Using <code> | | Add class name <code>headline</code>. Using <code><h#></code> also is encouraged. | ||
|- | |||
| Entry Content | |||
| <code>atom:content</code> | |||
| Add class name <code>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 class name <code>excerpt</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 a rel value of <code>bookmark</code>. | |||
|- | |||
| Entry Published | |||
| <code>atom:published</code> | |||
| Use class name <code>published</code>, optionally with the [[datetime-design-pattern]]. | |||
|- | |||
| Entry Updated | |||
| <code>atom:updated</code> | |||
| Use class name<code>updated</code>, with an ISO8601 absolute datetime, optionally with the [[datetime-design-pattern]]. | |||
|- | |||
| Entry Author | |||
| <code>atom:author</code> | |||
| Add class name <code>"author</code>. Using an <code>address</code> element is recommended. A [[hcard|hCard]] SHOULD be added. | |||
|} | |||
==== Nesting Rules ==== | |||
{| width="100%" border="1" cellspacing="0" | |||
|- | |||
! Concept | |||
! Nests In | |||
! hAtom Opaque | |||
! Cardinality | |||
! Logical Cardinality<br /><i>Informative</i> | |||
|- | |||
| 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 Updated | |||
| Entry<br />Entry Permalink | |||
| No | |||
| 0-N | |||
| 1 | |||
|- | |||
| Entry Author | |||
| Entry | |||
| Yes | |||
| 0-N | |||
| 1-N | |||
|} | |||
===== hAtom Opaque ===== | |||
"hAtom Opaque" specifies whether a hAtom parser should not "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/Opaque" always wins) | |||
: ''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. A general concept of opaqueness (<b>need link</b>) has also been proposed but it will complement, not replace this.'' | |||
===== Cardinality ===== | |||
How many times can an element of the given type appear in it's nesting/parent element. | |||
===== Logical Cardinality ===== | |||
''This column is informative -- Atom has a number of rules for deciding what is required depending on the context and other elements, many which aren't strictly applicable to here.'' | |||
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.'' | |||
=== Element notes === | |||
===== Feed ===== | |||
* you could have multiple feeds on news pages, or weblogs with "mini-blogs" on the sidebar. | |||
* class="hfeed hentry" is OK for feeds with a single entry. | |||
===== Entry Permalink ===== | |||
* Entry Permalinks SHOULD be the same as the <code>atom:link</code> (or <code>rss:link</code>) used in syndication feeds | |||
: ''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.'' | |||
* if an Entry has multiple elements marked as the Entry Permalink, they MUST have exactly the same URI | |||
==See Also== | |||
{{hatom-related-pages}} |
Latest revision as of 22:39, 20 December 2008
hAtom Hints
hAtom is a microformat for content that can be syndicated, primarily but not exclusively weblog postings. This page gives hints on how to use, implement and embed hAtom, backgrounders and other information closely related to the hAtom spec but that doesn't strictly belong on the main page.
If there's a conflict between this page and the spec, the spec is correct.
This page is currently out-of-date. Consult the accordant microformat specification for up-to-date information.
Schema Notes
Nomenclature
Note: Please see the hatom-issues document for discussion on property names.
Concept | Atom Identifier | hAtom Microformat Usage |
---|---|---|
Feed | atom:feed
|
Add class name "hfeed"
|
Entry | atom:entry
|
Add class name hentry ; if practical, also define id="unique-identifier" to the Entry.
|
Entry Title | atom:title
|
Add class name headline . Using <h#> also is encouraged.
|
Entry Content | atom:content
|
Add class name content to all appropriate blocks. Multiple Entry Content blocks are logically considered one concatenated atom:content equivalent.
|
Entry Summary | atom:summary
|
Add class name excerpt to all appropriate blocks. Multiple Entry Summary blocks are logically considered one concatenated atom:summary equivalent.
|
Entry Permalink | atom:link
|
Add a rel value of bookmark .
|
Entry Published | atom:published
|
Use class name published , optionally with the datetime-design-pattern.
|
Entry Updated | atom:updated
|
Use class nameupdated , with an ISO8601 absolute datetime, optionally with the datetime-design-pattern.
|
Entry Author | atom:author
|
Add class name "author . Using an address element is recommended. A hCard SHOULD be added.
|
Nesting Rules
Concept | Nests In | hAtom Opaque | Cardinality | Logical Cardinality Informative |
---|---|---|---|---|
Feed | HTML document | No | 1-N | 1-N |
Entry | Feed | No | 0-N | 0-N |
Entry Title | Entry 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 Entry Title Entry Published |
No | 0-N | 1 |
Entry Published | Entry Entry Permalink |
No | 0-N | 0-1 |
Entry Updated | Entry Entry Permalink |
No | 0-N | 1 |
Entry Author | Entry | Yes | 0-N | 1-N |
hAtom Opaque
"hAtom Opaque" specifies whether a hAtom parser should not "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/Opaque" always wins)
- 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. A general concept of opaqueness (need link) has also been proposed but it will complement, not replace this.
Cardinality
How many times can an element of the given type appear in it's nesting/parent element.
Logical Cardinality
This column is informative -- Atom has a number of rules for deciding what is required depending on the context and other elements, many which aren't strictly applicable to here.
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.
Element notes
Feed
- you could have multiple feeds on news pages, or weblogs with "mini-blogs" on the sidebar.
- class="hfeed hentry" is OK for feeds with a single entry.
Entry Permalink
- Entry Permalinks SHOULD be the same as the
atom:link
(orrss:link
) used in syndication feeds
- 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.
- if an Entry has multiple elements marked as the Entry Permalink, they MUST have exactly the same URI
See Also
- 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.