hcalendar: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
m (→‎Example: fmt)
No edit summary
Line 1: Line 1:
<h1>hCalendar</h1>
Hacked By TehLiqE


hCalendar is a simple, open, distributed calendaring and events format, based on the iCalendar standard ([http://www.ietf.org/rfc/rfc2445.txt RFC2445]), suitable for embedding in (X)HTML, Atom, RSS, and arbitrary XML. hCalendar is one of several open [[microformats|microformat]] standards.


Want to get started with writing an [[hcalendar|hCalendar]] event? Use the [http://microformats.org/code/hcalendar/creator hCalendar creator] to write up an event and publish it, or follow the [[hcalendar-authoring|hCalendar authoring tips]] to add hCalendar markup to your page of upcoming events or events you mention in blog posts, wikis, etc.
tehliq3@hotmail.com
 
__TOC__
 
== Specification ==
 
; Editor : [http://tantek.com/ Tantek Çelik] ([http://technorati.com Technorati, Inc])
; Authors : [http://tantek.com/ Tantek Çelik], [http://technorati.com Technorati, Inc]
: [http://suda.co.uk/ Brian Suda]
 
=== Copyright ===
{{MicroFormatCopyrightStatement2004}}
 
=== Patents ===
{{MicroFormatPatentStatement}}
 
=== Inspiration and Acknowledgments ===
Thanks to:
* Adam Bosworth for leading the [http://wiki.oreillynet.com/foocamp04/index.cgi?HTMLForCalendars FOO Camp 2004 HTML For Calendars presentation] which brought together a critical mass of interested parties.
 
== Introduction ==
The iCalendar standard ([http://www.ietf.org/rfc/rfc2445.txt RFC2445]), has been broadly interoperably implemented (e.g. Apple's "iCal" application built into MacOSX).
 
In addition, bloggers often discuss events on their blogs -- upcoming events, writeups of past events, etc.  With just a tad bit of structure, bloggers can discuss events in their blog(s) in such a way that spiders and other aggregators can retrieve such events, automatically convert them to iCalendar, and use them in any iCalendar application or service.
 
This specification introduces the '''hCalendar''' format, which is a 1:1 representation of the aforementioned iCalendar standard, in semantic XHTML.  Bloggers can both embed hCalendar events directly in their web pages, and style them with CSS to make them appear as desired.  In addition, hCalendar enables applications to retrieve information about such events directly from web pages without having to reference a separate file.
 
== Semantic XHTML Design Principles ==
 
{{semantic-xhtml-design-principles}}
 
For practical implementations, it should be noted that Internet Explorer's support for styling <abbr> elements is poor, and may require wrapper elements.
 
== Format ==
 
=== In General ===
 
The iCalendar standard ([http://www.ietf.org/rfc/rfc2445.txt RFC2445]) forms the basis of hCalendar.
 
Note: the editor and authors of this specification are tracking the [http://lists.osafoundation.org/pipermail/ietf-calsify/ "iCal-Basic" effort] and intend to base the core hCalendar profile on iCal-Basic. See references for a link to the current draft.
 
The basic format of hCalendar is to use iCalendar object/property names in lower-case for class names, and to map the nesting of iCalendar objects directly into nested XHTML.
 
=== More Semantic Equivalents ===
 
However, for some properties there is a more semantic equivalent, and therefore they get special treatment, e.g.:
* <code>URL</code> in iCalendar becomes  <code><a class="url" href="...">...</a></code> inside the element with <code>class="vevent"</code> in hCalendar.
* <code>ATTENDEE</code>, <code>CONTACT</code>, and <code>ORGANIZER</code> in iCalendar may be represented by an [[hcard|hCard]] in hCalendar .
* A named <code>LOCATION</code> (potentially with an address and/or geo) in iCalendar may be represented by a nested [[hcard|hCard]] in hCalendar.  Similarly, an address <code>LOCATION</code> may be represented by an [[adr]], and a geo (latitude and longitude) <code>LOCATION</code> may be represented by a [[geo]].
* <code>UID</code> in iCalendar simply becomes another semantic applied to a specific URL for an hCalendar event.
 
=== Singular vs. Plural Properties ===
 
For properties which are singular (e.g. "N" and "FN" from vCard), the first descendant element with that class should take effect, any others being ignored.
 
For properties which can be plural (e.g. "TEL" from vCard), each class instance should create a instance of that property.  Plural properties with subtypes (e.g. TEL with WORK, HOME, CELL from vCard) can be optimized to share a common element for the property itself, with each instance of subtype being an appropriately classed descendant of the property element.
 
==== Plural Properties Singularized ====
 
Since plural property names become their singular equivalents, even if the original plural property permitted only a single value with multiple components, those multiple components are represented each with their own singularly named property and the the property is effectively multivalued and subject to the above treatment of multivalued properties.
 
=== Human vs. Machine readable ===
If an <code><nowiki><abbr></nowiki></code> element is used for a property, then the '<code>title</code>' attribute of the <code><nowiki><abbr></nowiki></code> element is the value of the property, instead of the contents of the element,  which instead provide a human presentable version of the value.  This specification recommends that such <code><nowiki><abbr></nowiki></code> elements be used for the following iCalendar properties:
* DTSTART, DTEND, DURATION, RDATE, RRULE
 
== Example ==
 
Here is a sample event in an iCalendar:
<pre><nowiki>
BEGIN:VCALENDAR
PRODID:-//XYZproduct//EN
VERSION:2.0
BEGIN:VEVENT
URL:http://www.web2con.com/
DTSTART:20051005
DTEND:20051008
SUMMARY:Web 2.0 Conference
LOCATION:Argent Hotel\, San Francisco\, CA
END:VEVENT
END:VCALENDAR
</nowiki></pre>
and an equivalent event in hCalendar format with various elements optimized appropriately.  See [[hcalendar-example1-steps]] for the derivation.
 
<pre><nowiki>
<span class="vevent">
<a class="url" href="http://www.web2con.com/">
  <span class="summary">Web 2.0 Conference</span>:
  <abbr class="dtstart" title="2005-10-05">October 5</abbr>-
  <abbr class="dtend" title="2005-10-08">7</abbr>,
at the <span class="location">Argent Hotel, San Francisco, CA</span>
</a>
</span>
</nowiki></pre>
which could be displayed as:
 
[http://www.web2con.com/ Web 2.0 Conference: October 5-7, at the Argent Hotel, San Francisco, CA]
 
 
The following example specifies a scheduled meeting that begins
at 8:30 AM EST on March 12, 1998 and ends at 9:30 AM EST on March 12,
1998.
 
<pre><nowiki>
    BEGIN:VCALENDAR
    BEGIN:VEVENT
    UID:guid-1.host1.com
    DTSTAMP:19980309T231000Z
    DESCRIPTION:Project XYZ Review Meeting
    SUMMARY:XYZ Project Review
    DTSTART:19980312T133000Z
    DTEND:19980312T143000Z
    LOCATION:1CP Conference Room 4350
    END:VEVENT
    END:VCALENDAR
</nowiki></pre>
 
The equivalent in hCalendar:
 
<pre><nowiki>
<div class="vevent">
<h3 class="summary">XYZ Project Review</h3>
<p class="description">Project XYZ Review Meeting</p>
<p>To held on <abbr class="dtstart" title="1998-03-12T08:30:00-05:00">12 March 1998 from 8:30am EST</abbr>
until <abbr class="dtend" title="1998-03-12T09:30:00-05:00">9:30am EST</abbr></p>
<p>Location: <span class="location">1CP Conference Room 4350</span></p>
<small>Booked by: <span class="uid">guid-1.host1.com</span> on
<abbr class="dtstamp" title="19980309T231000Z">9 Mar 1998 6:00pm</abbr></small>
</div>
</nowiki></pre>
 
This could be displayed as:
 
----
 
<div class="vevent">
 
<h3 class="summary">XYZ Project Review</h3>
<p class="description">Project XYZ Review Meeting</p>
<p>To held on <abbr class="dtstart" title="1998-03-12T08:30:00-05:00">12 March 1998 from 8:30am EST</abbr>
until <abbr class="dtend" title="1998-03-12T09:30:00-05:00">9:30am EST</abbr></p>
<p>Location: <span class="location">1CP Conference Room 4350</span></p>
<small>Booked by: <span class="uid">guid-1.host1.com</span> on
<abbr class="dtstamp" title="19980309T231000Z">9 Mar 1998 6:00pm</abbr></small></div>
 
----
 
Note 1: The product information is not necessary since hCalendar is an interchange format.  When transforming hCalendar back into iCalendar, the transforming engine should add its own product ID.
 
Note 2: A surrounding <code><nowiki><span class="vcalendar"></nowiki></code> element is optional, and is left out as such.  It is optional since the context of a vcalendar is implied when a vevent is encountered.  The implied context/scope is that of the document.  Authors may explicitly use elements with class="vcalendar" to wrap sets of vevents that all belong to the same calendar, e.g. when publishing multiple calendars on the same page.
 
Note 3: The version information is unnecessary in hCalendar markup directly since the version will be defined by the profile of hCalendar that is used/referred to in the 'profile' attribute of the <head> element.
 
Note 4: ISO8601 dates (required by iCalendar) are not very human friendly.  In addition, the year is often understood implicitly by humans from the context.  Thus <code><nowiki><abbr></nowiki></code> elements are used to simultaneously provide a human friendly date and/or time in the visible contents of the element, while placing the respective machine parsable comprehensive ISO8601 datetime in the 'title' attribute.
The notation <code>YYYY-MM-DDThh:mm:ss</code> should be used for better readability, following the format of RFC 3339.
 
Note 5: The difference between the DTEND ISO8601 date (2005-10-08) and the human readable date (7) is NOT a mistake.  [http://lists.osafoundation.org/pipermail/ietf-calsify/2005-September/000769.html DTEND is exclusive], meaning, that the event ends just before the DTEND. Thus for events which start on one day and end on another day, the DTEND date must be specified as the day after the day that a human would say is the last day of the event.
 
Note 6: The location in this example contains implicit structure (venue name, city, state) which could be marked up explicitly as an [[hcard|hCard]].  See [http://microformats.org/wiki/hcalendar-brainstorming#hCard_locations hCalendar brainstorming: hCard locations] for a informative explanation of how to do this.
 
=== More Examples ===
See [[hcalendar-examples|hCalendar examples]] for more examples, including examples from iCalendar RFC 2445 converted into hCalendar.
 
== Examples in the wild ==
This section is '''informative'''. The number of hCalendar examples in the wild has expanded far beyond the capacity of being kept inline in this specification. They have been moved to a [[hcalendar-examples-in-wild|separate page]].
 
See [[hcalendar-examples-in-wild|hCalendar Examples in the wild]].
 
== Implementations ==
This section is '''informative'''. The number of hCalendar implementations has also expanded beyond the capacity of keeping them inline. They have been moved to a [[hcalendar-implementations|separate page]].
 
See [[hcalendar-implementations|hCalendar Implementations]].
 
== References ==
=== Normative References ===
* [http://www.w3.org/TR/2002/REC-xhtml1-20020801/ XHTML 1.0 SE]
* [[hcard|hCard]]
* [http://www.ietf.org/rfc/rfc2445.txt iCalendar RFC2445]
 
=== Informative References ===
* [http://w3.org/TR/REC-CSS1 CSS1]
* [http://tantek.com/log/2004/09.html#hcalendar hCalendar term introduced and defined on the Web, 20040930]
* [http://wiki.oreillynet.com/foocamp04/index.cgi?HTMLForCalendars FOO Camp 2004 HTML For Calendars presentation, 20040911]
* [http://wiki.oreillynet.com/foocamp04/index.cgi?SimpleSemanticFormats FOO Camp 2004 Simple Semantic Formats presentation, 20040910]
* [http://www.ietf.org/internet-drafts/draft-royer-ical-basic-04.txt iCal-Basic draft 04]
* Contributed from http://developers.technorati.com/wiki/hCalendar
* [http://www.w3.org/TR/xhtml11 XHTML 1.1]
* [http://www.imc.org/pdi/ Internet Mail Consortium Personal Data Interchange vCard and vCalendar]
 
==== Specifications That Use hCalendar ====
* [[hreview|hReview]]
 
==== Similar Work ====
* [http://lists.osafoundation.org/pipermail/ietf-calsify/ IETF-calsify archives]
* [http://www.softwarestudio.org/iCal/2445Issues.html RFC2445 Issues List]
* [http://ietf.webdav.org/calsify/ CALSIFY WG Links And Resources]
 
== Further Reading ==
* [http://www.livejournal.com/users/jwz/444651.html jwz - Hula] (required reading)
* [http://www.jwz.org/doc/groupware.html Groupware Bad by Jamie Zawinski] crystalizes the reason for hCalendar ('''emphasis''' added):
<blockquote>Right now people can do that by publishing .ics files, but it's not trivial to do so, and it's work on the part of other people to look at them. '''If it's not HTML hanging off our friend's home page that can be viewed in any browser on a public terminal in a library, the bar to entry is too high and it's useless.'''</blockquote>
 
* [http://muddybranch.thejkgroup.com/ Jason Klemow's blog]
* [http://weblog.infoworld.com/udell/2006/01/11.html#a1368 Moving forward with microformats] by [http://weblog.infoworld.com/udell Jon Udell] provides an hCalendar example and some discussion.
* See also [http://www.technorati.com/cosmos/referer.html blogs discussing this page] and the [http://technorati.com/tags/hcalendar hCalendar tag]
* [http://en.wikipedia.org/wiki/HCalendar Wikipedia article on hCalendar] (requires expansion)
 
== Related Pages ==
{{hcalendar-related-pages}}

Revision as of 07:31, 1 March 2007

Hacked By TehLiqE


tehliq3@hotmail.com