hentry: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(latest)
(Add Wayback Machine links for dead atomenabled.org references)
 
Line 19: Line 19:
* an Entry Category element is identified by [[rel-tag]]
* an Entry Category element is identified by [[rel-tag]]
* an Entry {{may}} have an Entry Category
* 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]
* an Entry Category element represents the concept of an [http://web.archive.org/web/20120616140751/http://www.atomenabled.org:80/developers/syndication/atom-format-spec.php#rfc.section.4.2.2 Atom category] (archived [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.2 original link] ) inside an [http://web.archive.org/web/20130112214940/http://www.atomenabled.org/developers/syndication/#optionalEntryElements entry] (archived [http://www.atomenabled.org/developers/syndication/#optionalEntryElements original link])
* the [[rel-tag]] <code>href</code> encodes the atom <code>category:term</code>; the link text defines the atom <code>category:label</code>
* the [[rel-tag]] <code>href</code> encodes the atom <code>category:term</code>; the link text defines the atom <code>category:label</code>


Line 25: Line 25:
* an Entry Title element is identified by the class name <code>entry-title</code>
* an Entry Title element is identified by the class name <code>entry-title</code>
* an Entry {{should}} have an 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]
* an Entry Title element represents the concept of an [http://web.archive.org/web/20120616140751/http://www.atomenabled.org:80/developers/syndication/atom-format-spec.php#rfc.section.4.2.14 Atom entry title] (archived [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.14 original link])
* if the Entry Title is missing, use
* if the Entry Title is missing, use
** the first <code>&lt;h#></code> element in the Entry, or
** the first <code>&lt;h#></code> element in the Entry, or
Line 34: Line 34:
* an Entry Content element is identified by class name <code>entry-content</code>
* an Entry Content element is identified by class name <code>entry-content</code>
* an Entry {{should}} have Entry Content
* 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 Content element represents the concept of an [http://web.archive.org/web/20120616140751/http://www.atomenabled.org:80/developers/syndication/atom-format-spec.php#rfc.section.4.1.3 Atom content] (archived [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#atomContent original link])
* 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
* 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.''
: ''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.''
Line 41: Line 41:
===== Entry Summary =====
===== Entry Summary =====
* an Entry Summary element is identified by class name <code>entry-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://web.archive.org/web/20120616140751/http://www.atomenabled.org:80/developers/syndication/atom-format-spec.php#rfc.section.4.2.13 Atom summary] (archived [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.13 original link])
* an Entry {{may}} have 0 or more Entry Summary elements. The "logical Entry Summary" of an Entry is the concatenation, in order of appearance, of all the Entry Summarys within the Entry
* an Entry {{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


Line 47: Line 47:
* an Entry Permalink element is identified by [[rel-bookmark]]
* an Entry Permalink element is identified by [[rel-bookmark]]
* an Entry {{should}} have an Entry Permalink
* 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]
* an Entry Permalink element represents the concept of an [http://web.archive.org/web/20120616140751/http://www.atomenabled.org:80/developers/syndication/atom-format-spec.php#rfc.section.4.2.7 Atom link in an entry] (archived [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.7 original link])
* 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
* 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 =====
===== Entry Updated =====
* an Entry Updated element is identified by class name <code>updated</code>
* 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 Updated element represents the concept of [http://web.archive.org/web/20120616140751/http://www.atomenabled.org:80/developers/syndication/atom-format-spec.php#rfc.section.4.2.15 Atom updated] (archived [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.15 original link])
* an Entry {{should}} have an Entry Updated element
* an Entry {{should}} have an Entry Updated element
* use the [[datetime-design-pattern]] to encode the updated datetime
* use the [[datetime-design-pattern]] to encode the updated datetime
Line 61: Line 61:
===== Entry Published =====
===== Entry Published =====
* an Entry Published element is identified by the class name <code>published</code>
* 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]
* an Entry Published element represents the concept of [http://web.archive.org/web/20120616140751/http://www.atomenabled.org:80/developers/syndication/atom-format-spec.php#rfc.section.4.2.9 Atom published] (archived [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.9 original link])
* use the [[datetime-design-pattern]] to encode the published datetime
* use the [[datetime-design-pattern]] to encode the published datetime


===== Entry Author =====
===== Entry Author =====
* an Entry Author element is represented by class name <code>author</code>
* 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 represents the concept of an [http://web.archive.org/web/20120616140751/http://www.atomenabled.org:80/developers/syndication/atom-format-spec.php#rfc.section.4.2.1 Atom author] (archived [http://www.atomenabled.org/developers/syndication/atom-format-spec.php#rfc.section.4.2.1 original link])
* an Entry Author element {{must}} be encoded in an [[hcard|hCard]]
* 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 Author element {{should}} be encoded in an <code>&lt;address></code> element

Latest revision as of 19:03, 25 March 2018

See latest version: h-entry

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 (archived original link ) inside an entry (archived original link)
  • 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 (archived original link)
  • 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 (archived original link)
  • 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 (archived original link)
  • 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 (archived original link)
  • 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 (archived original link)
  • 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
Entry Author
  • an Entry Author element is represented by class name author
  • an Entry Author element represents the concept of an Atom author (archived original link)
  • 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.

See Also