hcalendar: Difference between revisions
AndyMabbett (talk | contribs) (→Example: made example live; modifed to allow display of URL, updated to 2007 dates per linked website) |
AndyMabbett (talk | contribs) (Comment out NON FUNCTIONING example (was not working, even before my preceding edit) - needs attention) |
||
Line 108: | Line 108: | ||
Note that this is a '''live''' hCalendar microformat, which will be found on this page by parsers. | Note that this is a '''live''' hCalendar microformat, which will be found on this page by parsers. | ||
<!-- THIS EXAMPLE IS NOT DISPLAYING CORRECTLY - teh abbrs are ebnig shown as though "nowiki" applies | |||
=== Example 2=== | === Example 2=== | ||
Line 171: | Line 173: | ||
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. | 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. | ||
--> | |||
==Buttons== | ==Buttons== |
Revision as of 09:09, 29 March 2007
hCalendar
hCalendar is a simple, open, distributed calendaring and events format, based on the iCalendar standard (RFC2445), suitable for embedding in (X)HTML, Atom, RSS, and arbitrary XML. hCalendar is one of several open microformat standards.
Want to get started with writing an hCalendar event? Use the hCalendar creator to write up an event and publish it, or follow the hCalendar authoring tips to add hCalendar markup to your page of upcoming events or events you mention in blog posts, wikis, etc.
Specification
- Editor
- Tantek Çelik (Technorati, Inc)
- Authors
- Tantek Çelik, Technorati, Inc
- Brian Suda
Copyright
This specification is (C) 2004-2024 by the authors. However, the authors intend to submit (or already have submitted, see details in the spec) this specification to a standards body with a liberal copyright/licensing policy such as the GMPG, IETF, and/or W3C. Anyone wishing to contribute should read their copyright principles, policies and licenses (e.g. the GMPG Principles) and agree to them, including licensing of all contributions under all required licenses (e.g. CC-by 1.0 and later), before contributing.
Patents
This specification is subject to a royalty free patent policy, e.g. per the W3C Patent Policy, and IETF RFC3667 & RFC3668.
Inspiration and Acknowledgments
Thanks to:
- Adam Bosworth for leading the FOO Camp 2004 HTML For Calendars presentation which brought together a critical mass of interested parties.
Introduction
The iCalendar standard (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
Note: the Semantic XHTML Design Principles were written primarily within the context of developing hCard and hCalendar, thus it may be easier to understand these principles in the context of the hCard design methodology (i.e. read that first). Tantek
XHTML is built on XML, and thus XHTML based formats can be used not only for convenient display presentation, but also for general purpose data exchange. In many ways, XHTML based formats exemplify the best of both HTML and XML worlds. However, when building XHTML based formats, it helps to have a guiding set of principles.
- Reuse the schema (names, objects, properties, values, types, hierarchies, constraints) as much as possible from pre-existing, established, well-supported standards by reference. Avoid restating constraints expressed in the source standard. Informative mentions are ok.
- For types with multiple components, use nested elements with class names equivalent to the names of the components.
- Plural components are made singular, and thus multiple nested elements are used to represent multiple text values that are comma-delimited.
- Use the most accurately precise semantic XHTML building block for each object etc.
- Otherwise use a generic structural element (e.g.
<span>
or<div>
), or the appropriate contextual element (e.g. an<li>
inside a<ul>
or<ol>
). - Use class names based on names from the original schema, unless the semantic XHTML building block precisely represents that part of the original schema. If names in the source schema are case-insensitive, then use an all lowercase equivalent. Components names implicit in prose (rather than explicit in the defined schema) should also use lowercase equivalents for ease of use. Spaces in component names become dash '-' characters.
- Finally, if the format of the data according to the original schema is too long and/or not human-friendly, use
<abbr>
instead of a generic structural element, and place the literal data into the 'title' attribute (where abbr expansions go), and the more brief and human readable equivalent into the element itself. Further informative explanation of this use of<abbr>
: Human vs. ISO8601 dates problem solved
For practical implementations, it should be noted that Internet Explorer's support for styling elements is poor, and may require wrapper elements.
Format
In General
The iCalendar standard (RFC2445) forms the basis of hCalendar.
Note: the editor and authors of this specification are tracking the "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.:
URL
in iCalendar becomes<a class="url" href="...">...</a>
inside the element withclass="vevent"
in hCalendar.ATTENDEE
,CONTACT
, andORGANIZER
in iCalendar may be represented by an hCard in hCalendar .- A named
LOCATION
(potentially with an address and/or geo) in iCalendar may be represented by a nested hCard in hCalendar. Similarly, an addressLOCATION
may be represented by an adr, and a geo (latitude and longitude)LOCATION
may be represented by a geo. UID
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 <abbr>
element is used for a property, then the 'title
' attribute of the <abbr>
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 <abbr>
elements be used for the following iCalendar properties:
- DTSTART, DTEND, DURATION, RDATE, RRULE
Example
Here is a sample event in an iCalendar:
BEGIN:VCALENDAR PRODID:-//XYZproduct//EN VERSION:2.0 BEGIN:VEVENT URL:http://www.web2con.com/ DTSTART:20071017 DTEND:20071020 SUMMARY:Web 2.0 Conference LOCATION:Argent Hotel\, San Francisco\, CA END:VEVENT END:VCALENDAR
and an equivalent event in hCalendar format with various elements optimized appropriately. See hcalendar-example1-steps for the derivation.
<div class="vevent"> <a class="url" href="http://www.web2con.com/">http://www.web2con.com/</a> <span class="summary">Web 2.0 Conference</span>: <abbr class="dtstart" title="2007-12-17">October 5</abbr>- <abbr class="dtend" title="2007-12-20">19</abbr>, at the <span class="location">Argent Hotel, San Francisco, CA</span> </div>
which could be displayed as:
http://www.web2con.com/ Web 2.0 Conference: October 17- 19, at the Argent Hotel, San Francisco, CA
Note that this is a live hCalendar microformat, which will be found on this page by parsers.
Buttons
Don't forget that you can add one of our buttons to the page, to indicate the presence of hCalendar microformats. For example: . If you can link it back to this page (or even page on your website, about your use of the microformat), so much the better!
More Examples
See 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 separate page.
See 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 separate page.
See hCalendar Implementations.
References
Normative References
Informative References
- CSS1
- hCalendar term introduced and defined on the Web, 20040930
- FOO Camp 2004 HTML For Calendars presentation, 20040911
- FOO Camp 2004 Simple Semantic Formats presentation, 20040910
- iCal-Basic (latest) (draft 04)
- Contributed from http://developers.technorati.com/wiki/hCalendar
- XHTML 1.1
- Internet Mail Consortium Personal Data Interchange vCard and vCalendar
Specifications That Use hCalendar
Similar Work
Further Reading
- jwz - Hula (required reading)
- Groupware Bad by Jamie Zawinski crystalizes the reason for hCalendar (emphasis added):
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.
- Jason Klemow's blog
- Moving forward with microformats by Jon Udell provides an hCalendar example and some discussion.
- See also blogs discussing this page and the hCalendar tag
- Wikipedia article on hCalendar (requires expansion)
Related Pages
- hCalendar - specification
- hCalendar intro - plain English introduction
- hCalendar authoring - learn how to add hCalendar markup to your existing events.
- hCalendar creator (hCalendar creator feedback) - create your own hCalendar events.
- hCalendar cheatsheet - hCalendar properties
- hCalendar examples in the wild - an on-going list of websites which use hCalendars.
- hCalendar implementations - websites or tools which either generate or parse hCalendars
- hCalendar FAQ - If you have any questions about hCalendar, check here.
- hCalendar parsing - normative details of how to parse hCalendar.
- hCalendar profile - the XMDP profile for hCalendar
- hCalendar singular properties - an explanation of the list of singular properties in hCalendar.
- hCalendar tests - a wiki page with actual embedded hCalendar events to try parsing.
- hCalendar "to do" - jobs to do
- hCalendar advocacy - encourage others to use hCalendar.
- iCalendar implementations
This specification is a work in progress. As additional aspects are discussed, understood, and written, they will be added. These thoughts, issues, and questions are kept in separate pages.
- hCalendar Brainstorming - brainstorms and other explorations relating to hCalendar
- hCalendar issues - issues with the specification