hentry: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
No edit summary
Line 11: Line 11:
** '''bookmark''' (permalink). optional, using [[rel-bookmark]].
** '''bookmark''' (permalink). optional, using [[rel-bookmark]].
** '''tags'''. optional. keywords or phrases, using [[rel-tag]].
** '''tags'''. optional. keywords or phrases, using [[rel-tag]].
=== Field and Element Details ===
===== 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 [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]
* the [[rel-tag]] <code>href</code> encodes the atom <code>category:term</code>; the link text defines the atom <code>category:label</code>
===== Entry Title =====
* an Entry Title element is identified by the class name <code>entry-title</code>
* 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]
* if the Entry Title is missing, use
** the first <code>&lt;h#></code> element in the Entry, or
** the <code>&lt;title></code> 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 <code>entry-content</code>
* an Entry {{should}} have Entry Content
* an Entry Content element represents the concept of an [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#atomContent 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 <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 {{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 [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
===== Entry Updated =====
* an Entry Updated element is identified by class name <code>updated</code>
* 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 {{should}} have an Entry Updated element
* use the [[datetime-design-pattern]] 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 =====
* an Entry Published element is identified by the class name <code>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]
* use the [[datetime-design-pattern]] to encode the published datetime
===== Entry Author =====
* an Entry Author element is represented by class name <code>author</code>
* 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}} be encoded in an <code>&lt;address></code> 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 [[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]]
** otherwise the entry is invalid hAtom


== Examples in the wild ==
== Examples in the wild ==

Revision as of 22:25, 18 December 2011

Schema

The hEntry schema consists of the following properties:

  • hentry
    • entry-title. required. text.
    • entry-content. optional (see field description). text. [*]
    • entry-summary. optional. text.
    • updated. required using datetime-design-pattern. [*]
    • published. optional using datetime-design-pattern.
    • author. required using hCard. [*]
    • bookmark (permalink). optional, using rel-bookmark.
    • tags. optional. keywords or phrases, using rel-tag.

Field and Element Details

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 datetime-design-pattern 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
  • an Entry Published element is identified by the class name published
  • an Entry Published element represents the concept of Atom published
  • use the datetime-design-pattern to encode the published datetime
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

Examples in the wild

This section is informative.

The following sites have published hEntry, and thus are a great place to start for anyone looking for examples "in the wild" to try parsing, indexing, organizing etc., in addition to hEntry examples in the wild. If you find hEntry anywhere else, feel free to add them to the top of this list. Once the list grows too big, we'll make a separate wiki page.