hentry: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(Add Wayback Machine links for dead atomenabled.org references)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{latest|h-entry}}
=== Schema ===
=== Schema ===
The hEntry schema consists of the following properties:
The hEntry schema consists of the following properties:


* '''hentry'''
* '''hentry'''
** '''tag''' - Used to mark items which relate to the article or post. These are typically links to other pages which have similar information
** '''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 [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>
 
===== 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://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
** 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://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
: ''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://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
 
===== 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://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
 
===== Entry Updated =====
* an Entry Updated element is identified by class name <code>updated</code>
* 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
* 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://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
 
===== Entry Author =====
* an Entry Author element is represented by class name <code>author</code>
* 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 {{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 ==
Line 10: Line 80:
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|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.
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|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.


* [http://www.brandongparker.com The Blog of Brandon G Parker] uses hEvent for all blog posts e.g. [http://www.brandongparker.com/2011/12/04/maximizing-your-budget/ Maximizing Your Budget].
* [http://blog.sarahbmusselman.com/ Blog of Sarah B. Musselman] has initial support for hEntry with the use of [[bookmark]] and [[rel-tag]]
* [http://www.digyourlandscape.com Dig Your Landscape] uses hEvent for all blog posts e.g. [http://www.digyourlandscape.com/2011/06/06/planting-and-caring-for-flower-bulbs/ Planting and Caring for Flower Bulbs].
** Missing the [[hEntry]] encompassing tag
* [http://www.brandongparker.com The Blog of Brandon G Parker] marks up all blog posts with hentry, e.g. [http://www.brandongparker.com/2011/12/04/maximizing-your-budget/ Maximizing Your Budget].
* [http://www.digyourlandscape.com Dig Your Landscape] marks up all blog posts with hentry, e.g. [http://www.digyourlandscape.com/2011/06/06/planting-and-caring-for-flower-bulbs/ Planting and Caring for Flower Bulbs].
 
== See Also ==
* [[hAtom]]

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