hcalendar: Difference between revisions
m (more implementation organization) |
mNo edit summary |
||
Line 188: | Line 188: | ||
=== Browsing === | === Browsing === | ||
;Firefox extension : | ;Firefox extension : [http://blog.codeeg.com/tails-firefox-extension/ Tails is a Firefox Extension] that will display the presence of microformats ([[hcard|hCard]], [[hcalendar|hCalendar]], [[hreview|hReview]], [[xfolk|xFolk]]) on a webpage. | ||
=== Conversion === | === Conversion === | ||
Line 204: | Line 204: | ||
=== Libraries === | === Libraries === | ||
; Javascript : [http://virtuelvis.com/archives/2005/11/learn-to-love-microformats simple hCalendar parser] by [http://virtuelvis.com/ Arve Bersvendsen] | |||
; PHP : [http://randomchaos.com/microformats/base/ Microformat Base] is an open-source PHP microformat aggregation crawler, currently recognizing hreview, hcalendar, and hcard. | ; PHP : [http://randomchaos.com/microformats/base/ Microformat Base] is an open-source PHP microformat aggregation crawler, currently recognizing hreview, hcalendar, and hcard. | ||
; Ruby : [http://opensource.reevoo.com/2006/03/08/release-uformats-12/ uformats] is a ruby library that can parse [[hCalendar]], [[hCard]], [[hReview]] and [[rel-tag]] | ; Ruby : [http://opensource.reevoo.com/2006/03/08/release-uformats-12/ uformats] is a ruby library that can parse [[hCalendar]], [[hCard]], [[hReview]] and [[rel-tag]] | ||
; XSLT : | |||
* X2V is available as an XSLT library | * X2V is available as an XSLT library | ||
* [http://dev.w3.org/cvsweb/2001/palmagent/ palmagent] by [[User:DanC]] includes toICal.xsl and test materials; it works much like xhtml2vcal.xsl in X2V. See also: [http://www.w3.org/2002/12/cal/ RDF Calendar workspace] with icalendar test materials. | * [http://dev.w3.org/cvsweb/2001/palmagent/ palmagent] by [[User:DanC]] includes toICal.xsl and test materials; it works much like xhtml2vcal.xsl in X2V. See also: [http://www.w3.org/2002/12/cal/ RDF Calendar workspace] with icalendar test materials. |
Revision as of 12:55, 9 March 2006
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.
Draft Specification
Editor
Tantek Çelik (Technorati, Inc)
Authors
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
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
in iCalendar may in hCalendar be represented by an hcard.
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.
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:20051005 DTEND:20051008 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.
<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>
which could be displayed as:
Web 2.0 Conference: October 5-7, at the Argent Hotel, San Francisco, CA
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 <span class="vcalendar">
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 <abbr>
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 YYYY-MM-DD should be used for better readability.
Note 5: The difference between the DTEND ISO8601 date (2005-10-08) and the human readable date (7) is NOT a mistake. 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.
See hcalendar-examples for more hCalendar examples
Examples in the wild
This section is informative.
The following sites have implemented hCalendar, and thus are a great place to start for anyone looking for examples "in the wild" to try parsing, indexing, organizing etc. If events on your pages are marked up with hCalendar, feel free to add it to the top of this list. Once the list grows too big, we'll make a separate wiki page.
New Examples
Please add new examples to this section.
- Ning's cloneable Group app has hCalendar markup on its event calendar and event detail pages.
- Agenda: W3C Technical Plenary Day, March 1 2006 has hCard and hCalendar markup. (original here).
- The National Arbor Day Foundation has started using hCalendars for their upcoming conferences.
- The Multipack features a vevent for the next meeting information.
- State of Flux street art site has started adding events in hCalendar format
- The BarCamp home page lists upcoming BarCamps marked up with hCalenar and even has a "Subscribe..." link.
- 2006 W3C Technical Plenary Week has marked up the schedule and events for the week with hCalendar.
- code4lib Conference 2006 Schedule is marked up with hCalendar as announced on their blog.
- IEEE 754 Working Group - trying hCalendar for upcoming meetings.
- Elecciones 2005 Chile - the first spanish language hCalendar event found in the wild.
- Giocolando » No Creative Commons? No Party! is marked up with hCalendar
- CM Pros Events Calendar by Bob Doyle
- Midgard CMS Event calendar - as blogged by Henri Bergius
- Iowa Military Veterans Band Schedule - hCalendar markup added by Scott Reynen
- Upcoming events on Jason A.R. Moody Amusements Weblog posted by Jason Moody on 15 Oct 2005. His weblog in general has hCalendar events posted inside the blog posts.
- Syndicate - Tracks & Sessions
- Web 2.0 Conference schedule page marked up with hCalendar
- C'MON is a rock band from Canada, and their tour dates have been marked up by Ray Dickman with hCalendar.
- ifreebusy.com will display freebusy information using hCalendar. See this example.
- Web Essentials 05 has marked up their program schedule table with hCalendar, using the 'axis' and 'headers' attributes.
- ASDV Bonaparte is a Dutch debating society. Their events calendar has been marked up with the hCalendar conventions.
- Suw Charman has marked up her events with hCalendar.
- Blog Business Summit has published their event details marked up with hCalendar.
- EVDB, the Events and Venues database, publishes all events with hCalendar and venues with hCard. Took them only 15 minutes to implement both!
- Upcoming.org publishes all events and lists of events with hCalendar. Took them only an hour to add hCalendar support to the site.
- The Laughing Squid Calendar events, e.g. this party, now supports hCalendar.
- Paul Schreiber's Sunnyvale House Concerts site publishes hCalendar event information for upcoming concerts. In addition the Past Shows page contains hCalendar events for all past concerts.
- Paul Schreiber's unofficial schedule site publishes hCalendar information for upcoming hockey games at Ice Oasis
- Complex Spiral Consulting, both in the "Events" box on left side, and the separate Events page.
- Tantek's Thoughts, specifically the "Events" roll in the right-most column.
- Lesser Known Holidays, a list of holidays on suda.co.uk that can be imported via iCal and hCal so you can compare actual transformation versus intended.
- Norm Walsh's travel schedule use hCalendar as well as GRDDL.
- Policy Aware Web (PAW) Project Meeting uses hCalendar to record date-related decisions, and uses a vtodo microformat to record action items.
- The Kiez is a small cinema and has published its program marked up with hCalendar.
- The Laboratory for Dependable Distributed Systems publishes it's list of notable CfPs on dependability and security with hCalendar-todo elements.
- The Laughing Squid 10th Anniversary Party has an hcalendar page.
- SPRACI has hcalendar versions of its nightlife/clubbing/gigs/festivals listings for many cities worldwide - eg: Events in Sydney (check the API pages in the faq section of SPRACI for more info about the area/city keywords and category tags to use to get data for your city/categories
- WWF-Australia events calendars: What's on, Volunteer
Examples with some problems
- Web Analytics Association - hCalendar microformat is in place on all Tendenci sites on the calendar events search page and consolidated list page.
- WARNINGS
- has only dates where there should be datetime's
- has abbr's with no title
- should probably markup the description --RyanKing 16:04, 6 Jan 2006 (PST)
- WARNINGS
- s'Bokle is a German music pub. Their events calendar has been marked up with hCalendar.
- improper use of rrule --RyanKing 16:04, 6 Jan 2006 (PST)
Implementations
This section is informative.
The following implementations have been developed which either generate or parse hCalendars. If you have an hCalendar implementation, feel free to add it to the top of this list. Once the list grows too big, we'll make a separate wiki page.
Authoring
Implementations you can use to author, create, and publish hCalendar events.
Blogging and CMS tools
- Midgard CMS
- Midgard CMS - net.nemein.calendar - as blogged by Henri Bergius
- Drupal module
- Drupal Upcoming.org syndication module emits hCalendar
- Textpattern plug-in
- pnh_mf is a plugin for Textpattern that supports embedding hCalendar and other microformats in templates and blog posts. Written by Chris Casciano.
Browser scripts and plug-ins
Browser plugins that work with existing authoring tools:
- Any browser with javascript and a little bit of CSS
- microformats.org hCalendar creator (see also original: Ryan King has an hCalendar creator).
- Firefox Greasemonkey user script hCalendar creator
- magic_hcalendar Greasemonkey user script by Les Orchard - allows easy form entry of an event into any textarea, e.g. into a blog post text area.
Browsing
- Firefox extension
- Tails is a Firefox Extension that will display the presence of microformats (hCard, hCalendar, hReview, xFolk) on a webpage.
Conversion
Importing into a Calendar Application by converting hCalendar to iCalendar/vCalendar.
Server Based
These return iCalendar (.ics) and other calendar formats for easy importing into typical calendar programs or other processing.
- Technorati Events Feed service uses X2V library to parse hCalendar and return iCalendar (.ics). Note friendly URL, e.g. http://feeds.technorati.com/events/http%3A//microformats.org
- X2V parses hCalendar and produces a .ics (iCalendar) stream. Note: needs to be updated to track changes in the specification as they occur.
- Life Lint Parser parses hCalendar and produces .ics, .rdf and debugging information and attempts to be more fully compliant to the iCal standard than previous implementations. It can be used in the same manner as X2V. Can output iCal (w optional Outlook 2002 compat), and RDF.
- In xfy Community, there are some hCalendar implementations. "hCalendar via RSS" parses an RSS feed, retrieves XHTML documents linked from that feed, and syndicates hCalendars into a calendar view.
- JSCalendar parses hCalendar and produces a displayable HTML table/CSS-based calendar.
Firefox Browser Based
- George has built a Greasemonkey user script that detects hCalendar events and allows users to easily add them to their calendar application(s).
- David Janes has produced a Greasemonkey script that finds many microformat elements, including hCalendar events, and provides a popup menu of actions. The hCalendar to vCalendar conversion is done internally within the script. This does not work with FireFox 1.5+/GreaseMonkey 0.6.4+.
Libraries
- Javascript
- simple hCalendar parser by Arve Bersvendsen
- PHP
- Microformat Base is an open-source PHP microformat aggregation crawler, currently recognizing hreview, hcalendar, and hcard.
- Ruby
- uformats is a ruby library that can parse hCalendar, hCard, hReview and rel-tag
- XSLT
- X2V is available as an XSLT library
- palmagent by User:DanC includes toICal.xsl and test materials; it works much like xhtml2vcal.xsl in X2V. See also: RDF Calendar workspace with icalendar test materials.
Potential implementations
These are open source projects that could be potentially enhanced to support hCalendar.
- WebCalendar
- PHP iCalendar
- Investigation: Mozilla Calendar / Lightning / Sunbird hCalendar support discussion
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 draft 02
- Contributed from http://developers.technorati.com/wiki/hCalendar
- XHTML 1.1
Related
- iCalendar implementations
- IETF-calsify archives
- 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."
Similar Work
Discussions
This specification is a work in progress. As additional aspects are discussed, understood, and written, they will be added. There is a separate document where we are keeping our brainstorms and other explorations relating to hCalendar:
- See also blogs discussing this page.
- Moving forward with microformats by Jon Udell provides an hCalendar example and some discussion.
Q&A
- If you have any questions about hCalendar, check the hcalendar-faq, and if you don't find answers, add your questions!
Issues
- Please add any issues with the specification to the separate hcalendar-issues document.