hcalendar-authoring: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
No edit summary
(Undo revision 65056 by Hendrick (Talk))
(15 intermediate revisions by 8 users not shown)
Line 1: Line 1:
[[http://lesgirly.quotaless.com/topic/petinellis/ petinellis]] [[http://lazy-murrr.freehostia.com/resources/tracce-esami2/ tracce esami maturita 2004]] [[http://cthfht5.freehostia.com/directory/gsx2.htm gsx 750]] [[http://beloyar.freehostia.com/html/armerie-terni.htm armerie terni]] [[http://tyttor.freehostia.com/blog/looney-tunes8/ looney tunes 2]] [[http://xkobo.freehostia.com/blog/gps-garmin24/ gps garmin cartografico]] [[http://titinthewind.freehostia.com/blog/seno-add.htm seno add link]] [[http://arqene.freehostia.com/data/geforce8/ geforce 6200 256]] [[http://xkobo.freehostia.com/blog/akai-dvd/ akai dvd]] [[http://alitronthegr.h18.ru/hard-disk14/ hard disk cassetto]] [[http://www.r-kh05.pop3.ru/description/ocrida/ ocrida]] [[http://lazy-murrr.freehostia.com/resources/come-rubammo/ come rubammo la bomba atomica]] [[http://xkobo.freehostia.com/blog/ericsson-rs1/ ericsson r380s]] [[http://talindras.freehostia.com/styles/rendsburg.htm rendsburg]] [[http://is-bel.freehostia.com/description/la-vittima2/ la vittima sommersa]] [[http://drakuldemonking.freehostia.com/directory/nikon-62/ nikon 50 mm]] [[http://talindras.freehostia.com/styles/ati-radeon181.htm ati radeon 9250 256mb tv dvi]] [[http://dacrackster.freehostia.com/glow1/ glow 3]] [[http://just-whelmed.freehostia.com/html/lettore-divx40.htm lettore divx portatile hard disk]] [[http://arqene.freehostia.com/data/gang-bang13/ gang bang coppia]] [[http://tyttor.freehostia.com/blog/leccaculo/ leccaculo]] [[http://arqene.freehostia.com/data/core-spezzato/ core spezzato]] [[http://arqene.freehostia.com/data/bosch-sgu1/ bosch sgu 45]] [[http://cthfht5.freehostia.com/directory/te-quiero8.htm te quiero igual o mas que ayer]] [[http://alitronthegr.h18.ru/win-com/ win com]] [[http://imjss.freehostia.com/topic/programma-per18.htm programma per trasformare cd in mp3]] [[http://is-bel.freehostia.com/description/translator-pro1/ translator pro 9]] [[http://just-whelmed.freehostia.com/html/l-indiscreto.htm l indiscreto fascino del peccato film]] [[http://renkokitomi.freehostia.com/text/complimenti-laurea.htm complimenti laurea]] [[http://just-whelmed.freehostia.com/html/shawn-michaels.htm shawn michaels]] [[http://super-ioziki.freehostia.com/blog/giovani-ragazze.htm giovani ragazze]] [[http://imjss.freehostia.com/topic/trasmettitore-ricevitore1.htm trasmettitore ricevitore]] [[http://xkobo.freehostia.com/blog/staffa-videoproiettori/ staffa videoproiettori]] [[http://beloyar.freehostia.com/html/triestina.htm triestina 1949 50]] [[http://lazy-murrr.freehostia.com/resources/packard-bell66/ packard bell 512 mb radio]] [[http://drakuldemonking.freehostia.com/directory/the-big2/ the big circle mohicans]] [[http://tacogrrl.freehostia.com/library/ragazze-che1/ ragazze che se la toccano]] [[http://www.squirrel94085.pop3.ru/ups/ ups]] [[http://xkobo.freehostia.com/blog/panasonic-pt5/ panasonic pt lb20se]] [[http://renkokitomi.freehostia.com/text/foto-orrori.htm foto orrori]] [[http://just-whelmed.freehostia.com/html/recupero-crediti1.htm recupero crediti messina]] [[http://mariannah.pop3.ru/topic/acciaio-speciali/ acciaio speciali]] [[http://tacogrrl.freehostia.com/library/palmare-imate2/ palmare imate]] [[http://drakuldemonking.freehostia.com/directory/r-krlly/ r krlly]] [[http://lazy-murrr.freehostia.com/resources/e-fuji/ e550 fuji]] [[http://imjss.freehostia.com/topic/deriassa.htm deriassa]] [[http://www.r-kh05.pop3.ru/description/gagny/ gagny]] [[http://alitronthegr.h18.ru/hard-disk16/ hard disk 40 gb portatile]] [[http://tacogrrl.freehostia.com/library/cordles-duo/ cordles duo]] [[http://beloyar.freehostia.com/html/pesquisa.htm pesquisa]] [[http://www.r-kh05.pop3.ru/description/mulinello-surf/ mulinello surf casting]] [[http://talindras.freehostia.com/styles/cura-dell1.htm cura dell asma]] [[http://www.perla-e.pop3.ru/styles/casio-exilim1/ casio exilim z500]] [[http://tacogrrl.freehostia.com/library/usb-mp5/ usb mp3 zelig]] [[http://lazy-murrr.freehostia.com/resources/giochi-sui1/ giochi sui skateboard]] [[http://yarowrath.quotaless.com/new/e-commerce/ e commerce moda]] [[http://beloyar.freehostia.com/html/john-bon.htm john bon jovi]] [[http://is-bel.freehostia.com/description/gps-yakumo/ gps yakumo delta 300]] [[http://alitronthegr.h18.ru/soluzione-spyro/ soluzione spyro]] [[http://sugarbear280.freehostia.com/non-me17.htm non me loso spiegare]] [[http://xkobo.freehostia.com/blog/cresus/ cresus]] [[http://www.perla-e.pop3.ru/styles/patrizia-rossetto/ patrizia rossetto]] [[http://www.r-kh05.pop3.ru/description/old-kentucky/ old kentucky]] [[http://xkobo.freehostia.com/blog/northridge-e/ northridge e20]] [[http://tyttor.freehostia.com/blog/tesina-liceo2/ tesina liceo classico]] [[http://yutta.quotaless.com/description/ladaaba/ ladaaba]] [[http://talindras.freehostia.com/styles/carmen-russo1.htm carmen russo che fa pompini]] [[http://tacogrrl.freehostia.com/library/xd-fuji1/ xd fuji 512]] [[http://www.squirrel94085.pop3.ru/ma-cum/ ma cum se fa a dar tormento all anima]] [[http://titinthewind.freehostia.com/blog/shake-it8.htm shake it sakis rouvas]] [[http://imjss.freehostia.com/topic/www-unpostoalsole2.htm www unpostoalsole com]] [[http://arqene.freehostia.com/data/warwick-massa/ warwick massa]] [[http://tommyw.h18.ru/view/cavia-torna/ cavia torna al lavoro]] [[http://embem30.quotaless.com/oro-diamante/ oro diamante]] [[http://titinthewind.freehostia.com/blog/editor-wysiwyg.htm editor wysiwyg]] [[http://super-ioziki.freehostia.com/blog/equipe-5.htm equipe 84 resta]] [[http://xkobo.freehostia.com/blog/golf17/ golf 1 4 2004]] [[http://tacogrrl.freehostia.com/library/pitates-of/ pitates of the caribbean]] [[http://lazy-murrr.freehostia.com/resources/volkswagen-polo24/ volkswagen polo 14 tdi]] [[http://renkokitomi.freehostia.com/text/todos-los1.htm todos los temas del grupo niche]] [[http://xkobo.freehostia.com/blog/nikon-obiettivi3/ nikon obiettivi sigma 14 mm]] [[http://xkobo.freehostia.com/blog/www-honish/ www honish it]] [[http://talindras.freehostia.com/styles/diga-del.htm diga del vaiont]] [[http://egocentricfreak.freehostia.com/html/leducazione-dei/ leducazione dei sentimenti]] [[http://yarowrath.quotaless.com/new/hotel-tallin/ hotel tallin]] [[http://cthfht5.freehostia.com/directory/video-caccia1.htm video caccia]] [[http://www.wojzeh.pop3.ru/new/get-up/ get up kids]] [[http://cthfht5.freehostia.com/directory/librium-.htm librium 30 cps 10 mg]] [[http://drakuldemonking.freehostia.com/directory/gps-bt4/ gps bt 338]] [[http://just-whelmed.freehostia.com/html/lavoro-ad.htm lavoro ad olbia]] [[http://seholwag.quotaless.com/text/fuochi-ultimi/ fuochi ultimi]] [[http://renkokitomi.freehostia.com/text/adattatore-da3.htm adattatore da usb a tv]] [[http://cthfht5.freehostia.com/directory/gay-scugnizzi.htm gay scugnizzi]] [[http://dacrackster.freehostia.com/deskjet10/ deskjet 450]] [[http://egocentricfreak.freehostia.com/html/network-marketing/ network marketing]] [[http://is-bel.freehostia.com/description/ray-ban66/ ray ban aviator 3243]] [[http://orangeyuni.freehostia.com/html/corona-boreale/ corona boreale]] [[http://bloodmader.quotaless.com/panasonic-/ panasonic  a102]] [[http://tommyw.h18.ru/view/vetroceramica-piani/ vetroceramica piani cottura]] [[http://tommyw.h18.ru/view/abito-misura/ abito misura]] [[http://www.ccrs.uzh.ch/user/root/pvlgrc.html Listino ufficiale auto usata]] [[http://www.startonlineweb.com/help/new/ibkrlh.html Refinancing mortgage]] [[http://www.worthwhilehosting.com/banners/auto/vxhlfw.html Creare temi nokia 5200]] [[http://www.notreligion.com/help/files/gwmxqo.html Foot fetish]] [[http://www.priceisking.co.uk/skins/default/vpdemr.html Insana clown posse tatoo]] [[http://www.startonlineweb.com/help/new/pxxvju.html Parquet prefinito bamflor]] [[http://www.ccrs.uzh.ch/user/root/aehcvd.html Porno sulmona]] [[http://cale.cc/xde/it/egpuxt.html Nere fighe]] [[http://www.notreligion.com/help/files/khvpfc.html Assicurazione telefonica preventivo]] [[http://www.hiidenkivenpaivakoti.fi/help/new/pppvjq.html Europaconcorsi]] [[http://www.notreligion.com/help/files/wtxruq.html Salumi italiani]] [[http://www.nvwp.org/help/files/xgsnwr.html Fighe sverginate]] [[http://rootos.idonea.cl/help/files/bskukr.html Ragazze incontri]] [[http://www.ccrs.uzh.ch/user/root/rifqbg.html Grand hotel sorrento]] [[http://rootos.idonea.cl/help/files/dbthln.html Foto uomo muscoloso nudo gratuita]] [[http://www.startonlineweb.com/help/new/epjfsi.html Albergo col cane arles]] [[http://www.nvwp.org/help/files/fkkfqm.html Anal luana borgia]] [[http://www.nvwp.org/help/files/ufidvm.html Pantyhose sex girl]] [[http://www.nvwp.org/help/files/qskdmv.html Connessione veloce]] [[http://www.worthwhilehosting.com/banners/auto/nvlvtq.html Hotel toscana]] [[http://www.actionscript.ru/help/files/dlhetw.html Tattuaggi]] [[http://www.startonlineweb.com/help/new/mqupqj.html Calcola codice fiscale]] [[http://www.hiidenkivenpaivakoti.fi/help/new/ugqxxu.html Andamento euribor]] [[http://www.nvwp.org/help/files/qpbgks.html Traduttore italiani-inglese]] [[http://rootos.idonea.cl/help/files/lhhclk.html Raffaello unime it almalaurea default htm]] [[http://www.nvwp.org/help/files/cuxqum.html Dietamed coito interrotto]] [[http://rootos.idonea.cl/help/files/ikcxsq.html Patente punto]] [[http://www.notreligion.com/help/files/fwlhpk.html Castorama]] [[http://www.priceisking.co.uk/skins/default/imssot.html Sviluppo integrazione software]] [[http://www.startonlineweb.com/help/new/cardrv.html Fake celebrita]] [[http://rootos.idonea.cl/help/files/mbumgx.html Contratto prestito online]] [[http://cale.cc/xde/it/mcwhrh.html Banca apulia]] [[http://www.worthwhilehosting.com/banners/auto/xshrhq.html Mappa cerignola]] [[http://www.hiidenkivenpaivakoti.fi/help/new/dsenea.html Banca sanpaolo]] [[http://www.worthwhilehosting.com/banners/auto/raweew.html Hentay x]] [[http://cale.cc/xde/it/tptbbl.html Hotel birmingham]] [[http://www.priceisking.co.uk/skins/default/fmswsl.html Procol harum]] [[http://www.priceisking.co.uk/skins/default/dhejiu.html Katie fey]] [[http://rootos.idonea.cl/help/files/wnrons.html Buy ephedrine]] [[http://www.ccrs.uzh.ch/user/root/kurwba.html Mediasetpremium it]] [[http://www.notreligion.com/help/files/tkrptu.html Gazebo in ferro]] [[http://cale.cc/xde/it/bjalom.html Veline nude]] [[http://www.priceisking.co.uk/skins/default/qqieuk.html Wet panties]] [[http://www.backtothebible.org/help/files/bbxvqf.html Www pornoyoutube com]] [[http://www.nvwp.org/help/files/dsfmeu.html Massimiliano rosolino]] [[http://www.hiidenkivenpaivakoti.fi/help/new/lsmmch.html Corsi per carrellista]] [[http://cale.cc/xde/it/oltwbq.html Albergo cordoba]] [[http://www.notreligion.com/help/files/lscqdc.html Amburgo hotel]] [[http://rootos.idonea.cl/help/files/ghbmmn.html Prestito veloce dei soldo]] [[http://www.actionscript.ru/help/files/vgkhlp.html Sesso virtuale msn gratis registrazione]] [[http://www.worthwhilehosting.com/banners/auto/gjnrlb.html Porco]] [[http://www.hiidenkivenpaivakoti.fi/help/new/jtlhol.html Sfondi glitterati]] [[http://www.nvwp.org/help/files/keshus.html Melita 2008]] [[http://www.actionscript.ru/help/files/mqvxsb.html Gilmore girls spoiler]] [[http://www.worthwhilehosting.com/banners/auto/secnef.html Sito ufficiale frase romantica]] [[http://www.actionscript.ru/help/files/seimtm.html Prestito personali finanziaria]] [[http://www.startonlineweb.com/help/new/vtwttg.html Raffaella carra]] [[http://www.worthwhilehosting.com/banners/auto/phjiku.html Controllo gestione]] [[http://www.priceisking.co.uk/skins/default/qhqurl.html Hotel francoforte]] [[http://www.backtothebible.org/help/files/hmionp.html Radio2]] [[http://www.actionscript.ru/help/files/datepv.html Puttane brasiliane]] [[http://www.backtothebible.org/help/files/fjtedj.html Metropolitana roma]] [[http://www.nvwp.org/help/files/fmqivk.html Impianto irrigazione]] [[http://www.notreligion.com/help/files/dvmftu.html Carolina kostner]] [[http://www.hiidenkivenpaivakoti.fi/help/new/dqxwmc.html 3gp sex]] [[http://www.nvwp.org/help/files/rfiftt.html Grandi cazzi gratis]] [[http://www.actionscript.ru/help/files/ruvfnd.html Anteprima video xxx]] [[http://rootos.idonea.cl/help/files/ivfcsl.html Mobili usati milano]] [[http://www.worthwhilehosting.com/banners/auto/rtjmlo.html Nomi pornostar]] [[http://www.nvwp.org/help/files/wavvvx.html Prestito conveniente]] [[http://rootos.idonea.cl/help/files/auhbwd.html Prenotazione volo aereo istanbul]] [[http://www.backtothebible.org/help/files/esrqlq.html Villaggio ventaglio sardegna]] [[http://www.worthwhilehosting.com/banners/auto/vjbmmv.html Apertura on line conto corrente bancario]] [[http://www.priceisking.co.uk/skins/default/cfstxm.html Sessolibero it]] [[http://www.hiidenkivenpaivakoti.fi/help/new/ogewrv.html chiamami]] [[http://www.nvwp.org/help/files/okmwkl.html Patrick ray pugliese]] [[http://www.ccrs.uzh.ch/user/root/geinsg.html Tesina burattino]] [[http://www.backtothebible.org/help/files/vojaow.html Buspar]] [[http://www.backtothebible.org/help/files/dowhit.html Video porno naruto]] [[http://www.startonlineweb.com/help/new/sqnnuq.html Scafati]] [[http://www.actionscript.ru/help/files/xuwfgi.html Body jewellery]] [[http://www.worthwhilehosting.com/banners/auto/qitubp.html Ristorante tipico torino]] [[http://www.actionscript.ru/help/files/dtltmk.html Praticanti]] [[http://www.startonlineweb.com/help/new/pfhetn.html Oreck]] [[http://www.priceisking.co.uk/skins/default/fdgvfj.html Nodi per l alpinismo]] [[http://www.backtothebible.org/help/files/nweukn.html Job espresso]] [[http://cale.cc/xde/it/ddglfs.html Vino toscana]] [[http://www.ccrs.uzh.ch/user/root/wkihow.html Ottenere prestito on line]] [[http://www.startonlineweb.com/help/new/iorjfo.html Vacanza lastminute]] [[http://www.ccrs.uzh.ch/user/root/euhegb.html Ragazze vogliose]] [[http://www.ccrs.uzh.ch/user/root/hoglkd.html Gattino regalo]] [[http://www.ccrs.uzh.ch/user/root/rwbnjg.html Sell annuity]] [[http://www.priceisking.co.uk/skins/default/ppacng.html Vip uomini nudi]] [[http://www.priceisking.co.uk/skins/default/uvmkdw.html Xxx password]] [[http://cale.cc/xde/it/auxitg.html Film in reteit]] [[http://www.backtothebible.org/help/files/rdhupb.html Zurigo albergo]] [[http://www.notreligion.com/help/files/wjomci.html Auto rimorchio trasporto]] [[http://cale.cc/xde/it/fxxosm.html Frasi nascita]] [[http://www.startonlineweb.com/help/new/ccbasm.html Negozi hardware]] [[http://www.actionscript.ru/help/files/wndpbc.html Moto quotazione usata]] <h1>hCalendar authoring</h1>
<entry-title>hCalendar authoring</entry-title>


This page contains useful tips and guidelines for how to author [[hcalendar|hCalendar]] events, either from scratch, or by adding markup to existing content.
This page contains useful tips and guidelines for how to author [[hcalendar|hCalendar]] events, either from scratch, or by adding markup to existing content.
Line 8: Line 8:


'''Author(s):''' Tantek Çelik
'''Author(s):''' Tantek Çelik
__TOC__


== Creating new hCalendar events ==
== Creating new hCalendar events ==
Line 19: Line 17:
=== Minimal Markup Changes ===
=== Minimal Markup Changes ===


The important thing to keep in mind when adding microformats to existing content, is the fact that microformats are designed so that they can be added with minimal (almost always no) changes to the existing presentation of the page.  Thus keep this in mind: change as little markup as possible.  If you want to fix various pages to be valid XHTML as well, that's fine goal and highly encouraged.
The important thing to keep in mind when adding microformats to existing content, is the fact that microformats are designed so that they can be added with minimal (almost always no) changes to the existing presentation of the page.  Thus keep this in mind: change as little markup as possible.  If you want to fix various pages to be valid XHTML as well, that's a fine goal and highly encouraged.


=== Find Events ===
=== Find Events ===


Start with looking for all mentions of events on a page, such as an "Upcoming Events" or "Recent Events" listing.  Those are all potential hCalendar events.  Even more so if they are linked to their respective URLs (e.g. per event pages with more details).
Start with looking for all mentions of events on a page, such as an "Upcoming Events" or "Recent Events" listing.  Those are all potential hCalendar events - even more so if they are linked to their respective URLs (e.g. to single event pages with more details).


If an event is mentioned several times on a page, consider marking up the mention which is the most persistent, detailed, definitive, or otherwise thorough as an hCalendar event.  Ideally you might want to mark up ''all'' instances of a events with hCalendar, but for now, just keep it simple and markup the most representative instance. (Perhaps the most "definitive" instance, which could also then be marked up with a <code><nowiki><dfn></nowiki></code> element around the summary/title of the event for additional semantic XHTML goodness.)
If an event is mentioned several times on a page, consider marking up an hCalendar event the mention which is the most persistent, detailed, definitive, or otherwise thorough.  Ideally you might want to mark up ''all'' instances of a events with hCalendar, but for now, just keep it simple and mark up the most representative instance. (Perhaps the most "definitive" instance, which could also then be marked up with a <code><nowiki><dfn></nowiki></code> element around the summary/title of the event for additional semantic XHTML goodness.)


=== Determine The Surrounding Element for Each ===
=== Determine The Surrounding Element for Each ===
Line 41: Line 39:
For instance, assuming you have the following markup:  
For instance, assuming you have the following markup:  


<pre><nowiki>
<source lang=html4strict>
    <div class="someFoo">
<div class="someFoo">
      <p> This is my wonderful markup, it contains some event information inside of it</p>
  <p> This is my markup, it contains some event information</p>
      <h6>Some Wonderful Event</h6>
  <h6>Some Wonderful Event</h6>
      <p> From the people who brought you Great Times and Fun Lovin,  
  <p> From the people who brought you Great Times and Fun Lovin,  
          comes the Some Wonderful Event at the Local Sports Stadium.   
      comes the Some Wonderful Event at the Local Sports Stadium.   
          Come at <b>A Specified Time</b>, and enjoy yourself! </p>
      Come at <b>A Specified Time</b>, and enjoy yourself! </p>
    </div>
</div>
</nowiki></pre>
</source>


If you need to add an element with the class of "vevent" around your event content, you could re-use the existing div element, and add the class "vevent" to it like so:
If you need to add an element with the class of "vevent" around your event content, you could re-use the existing div element, and add the class "vevent" to it like so:
<pre><nowiki>
<source lang=html4strict>
    <div class="someFoo vevent">
<div class="someFoo vevent">
</nowiki></pre>
</source>
Similarly, if you decide not to re-purpose an existing container, you can just wrap the content around a new block:
Similarly, if you decide not to re-purpose an existing container, you can just wrap the content around a new block:
<pre><nowiki>
<source lang=html4strict>
    <div class="someFoo">
<div class="someFoo">
      <div class="vevent">
  <div class="vevent">
        <p> This is my wond...
    <p> This is my wond...
        ...
        ...
        ... and enjoy yourself! </p>
        ... and enjoy yourself! </p>
      </div>
  </div>
    </div>
</div>
</nowiki></pre>
</source>


=== The Importance of Time and Topic ===
=== The Importance of Time and Topic ===
Line 70: Line 68:
Several properties are required in hCalendar. At a minimum, an event needs a "summary" (AKA title) and "dtstart" (starting date time), as well as either a "dtend" (ending date time) or "duration". Thus be sure to mark up the name/summary/title of the event with the class name "summary".  E.g.  
Several properties are required in hCalendar. At a minimum, an event needs a "summary" (AKA title) and "dtstart" (starting date time), as well as either a "dtend" (ending date time) or "duration". Thus be sure to mark up the name/summary/title of the event with the class name "summary".  E.g.  


<pre><nowiki>
<source lang=html4strict>
<div class="vevent">
<div class="vevent">
  <span class="summary">An Event Apart, New York City, NY</span>,
  <span class="summary">An Event Apart, New York City, NY</span>,
  <abbr class="dtstart" title="20060710">July 10</abbr>-<abbr class="dtend" title="20060712">11th, 2006</abbr>
  <abbr class="dtstart" title="2006-07-10">July 10</abbr> -
</div></nowiki></pre>
<abbr class="dtend" title="2006-07-11">11th, 2006</abbr>
</div>
</source>


This event might be presented like:
This event might be presented like:


An Event Apart, New York City, NY, <abbr class="dtstart" title="20060710">July 10</abbr>-<abbr class="dtend" title="20060712">11th, 2006</abbr>
An Event Apart, New York City, NY, <abbr class="dtstart" title="2006-07-10">July 10</abbr> - <abbr class="dtend" title="2006-07-11">11th, 2006</abbr>
 
Note: the use of the abbr element's title attribute to mark up a machine readable absolute datetime in addition to the human readable text.
 
==== Separate dates and times ====
Sometimes pages show the date of an event and its times separately, perhaps for stylistic or layout reasons, e.g. the [http://sphcm.washington.edu/cal/cal.asp SPHCM Events Calendar] puts the date in a heading, and the times following it in another div:
 
<source lang=html4strict>
...
<h3>October 2</h3>
<div>3:30 pm - 4:50 pm</div>
...
</source>
 
In such cases, rather than having to redo the markup (which may be serving other purposes) to combine the start date and time into a single element, use a wrapping div to mark up the date and start time with <code>dtstart</code> and a span for just the end time with <code>dtend</code>, e.g.: (whitespace added for readability)
 
<source lang=html4strict>
...
<div class="dtstart">
<h3><abbr class="value" title="2007-10-02">October 2</abbr></h3>
<div>
  <span class="value">3:30 pm</span> - <span class="dtend">4:50 pm</span>
</div>
</div>
...
</source>
 
This example makes use of the [[value-class-pattern]], specifically both the [[value-class-pattern#Date_and_time_values|date and time separation]] and [[value-class-pattern#hCalendar_dtend_implied_date|implied dtend date]] techniques.
 
Completed event example with date and times:
 
<source lang=html4strict>
<div class="vevent">
  <h2 class="summary">Seminar on authoring vs examples</h2>
  <div class="dtstart">
    <h3><abbr class="value" title="2007-10-02">October 2</abbr></h3>
    <div>
      <span class="value">3:30 pm</span> - <span class="dtend">4:50 pm</span>
    </div>
  </div>
</div>
</source>
 
Here's another event with the times preceding the date, and location information as well:
 
<source lang=html4strict>
<div class="vevent">
  <div class="summary">How to take care of your markup</div>
  <div class="dtstart">
    Date: <span class="value">9am</span> - <span class="dtend">11am</span>,
    <abbr class="value" title="2011-09-15">9/15/2011</abbr>
  </div>
  <div>Location: <span class="location">123 Main st., Beaverton, OR</span></div>
</div>
</source>
 
Note that the location can be further marked up with the [[adr]] microformat. See the [[#Location_Location_Location|Location Examples]] section below for more details.


Note: the use of the abbr element's title attribute to markup a machine readable absolute datetime in addition to the human readable text.  Note also that the machine readable ending date is the day *after* the date specified in the human readable content.  The reason for this is that hCalendar still interprets an ending date without a time as an instant in time, that is midnight, the absolute beginning of that day, thus ending the event the day before.  See [[hcalendar|hCalendar]] and [[hcalendar-example1-steps]] for more details on the use of the abbr element in this fashion.


=== Eliminating Default Dotted Underline ===
=== Eliminating Default Dotted Underline ===
 
Some browsers (Camino, Firefox, Mozilla) put a <span style="border-bottom:dotted 1px">dotted underline</span> or border on each <abbr title="abbreviation">abbr</abbr>. You can use the following rule in your style sheet to eliminate this default presentation.
Some browsers (Camino, Firefox, Mozilla) put a <span style="border-bottom:dotted 1px">dotted underline or border</span> on each <abbr title="abbreviation">abbr</abbr>. This is typically an ugly effect and distracting in most clean modern web designs.  Thus be sure to use the following rule in your style sheet to eliminate this default presentation.


<pre><nowiki>
<pre><nowiki>
abbr{border:0}
.vevent abbr{border:0}
</nowiki></pre>
</nowiki></pre>


In the above example, this would have the following effect (which may not look any different for some readers):
In the above An Event Apart example, this would have the following effect (which may not look any different for some readers):


An Event Apart, New York City, NY, <abbr style="border:0" class="dtstart" title="20060710">July 10</abbr>-<abbr style="border:0" class="dtend" title="20060712">11th, 2006</abbr>
An Event Apart, New York City, NY, <abbr style="border:0" class="dtstart" title="2006-07-10">July 10</abbr> - <abbr style="border:0" class="dtend" title="2006-07-11">11th, 2006</abbr>


=== Representative URLs ===
=== Representative URLs ===
Line 100: Line 154:
"Event Rolls" are a good example of this (see also [[xoxo|XOXO]] for proper semantic list and outline markup).
"Event Rolls" are a good example of this (see also [[xoxo|XOXO]] for proper semantic list and outline markup).


Since the class attribute takes a space separated set of class names, one can often markup the URL on the same element as the name, e.g. by replacing the first <code><nowiki><span></nowiki></code> in the above example with an <code><nowiki><a href></nowiki></code> hyperlink:
Since the class attribute takes a space separated set of class names, one can often mark up the URL on the same element as the name, e.g. by replacing the first <code><nowiki><span></nowiki></code> in the above example with an <code><nowiki><a href></nowiki></code> hyperlink:


<pre><nowiki>
<pre><nowiki>
<div class="vevent">
<div class="vevent">
  <a href="http://aneventapart.com/events/2006/nyc/" class="summary url">An Event Apart, New York City, NY</a>,
  <a href="http://aneventapart.com/events/2006/nyc/" class="summary url">An Event Apart, New York City, NY</a>,
  <abbr class="dtstart" title="20060710">July 10</abbr>-<abbr class="dtend" title="20060712">11th, 2006</abbr>
  <abbr class="dtstart" title="2006-07-10">July 10</abbr> -  
<abbr class="dtend" title="2006-07-11">11th, 2006</abbr>
</div></nowiki></pre>
</div></nowiki></pre>


This event might be presented like:
This event might be presented like:


[http://aneventapart.com/events/2006/nyc/ An Event Apart, New York City, NY], <abbr style="border:0" class="dtstart" title="20060710">July 10</abbr>-<abbr style="border:0" class="dtend" title="20060712">11th, 2006</abbr>
[http://aneventapart.com/events/2006/nyc/ An Event Apart, New York City, NY], <abbr style="border:0" class="dtstart" title="2006-07-10">July 10</abbr> - <abbr style="border:0" class="dtend" title="2006-07-11">11th, 2006</abbr>


=== Location Location Location ===
=== Location Location Location ===


As with real estate, the location of an event is quite relevant, and important to markup properly. At a minimum, identify the location related information in the event and mark it up with the class name of "location", e.g. continuing with the above example:
As with real estate, the location of an event is quite relevant, and important to mark up properly. At a minimum, identify the location related information in the event and mark it up with the class name of "location", e.g. continuing with the above example:


<pre><nowiki>
<pre><nowiki>
Line 120: Line 175:
  <a href="http://aneventapart.com/events/2006/nyc/" class="summary url">An Event Apart,  
  <a href="http://aneventapart.com/events/2006/nyc/" class="summary url">An Event Apart,  
   <span class="location">New York City, NY</span></a>,  
   <span class="location">New York City, NY</span></a>,  
  <abbr class="dtstart" title="20060710">July 10</abbr>-<abbr class="dtend" title="20060712">11th, 2006</abbr>
  <abbr class="dtstart" title="2006-07-10">July 10</abbr> -
<abbr class="dtend" title="2006-07-11">11th, 2006</abbr>
</div></nowiki></pre>
</div></nowiki></pre>


Line 128: Line 184:
<div class="vevent">
<div class="vevent">
  <a href="http://aneventapart.com/events/2006/nyc/" class="summary url">An Event Apart,  
  <a href="http://aneventapart.com/events/2006/nyc/" class="summary url">An Event Apart,  
   <span class="location adr"><span class="locality">New York City</span>, <span class="region">NY</span></span></a>,  
   <span class="location adr">
  <abbr class="dtstart" title="20060710">July 10</abbr>-<abbr class="dtend" title="20060712">11th, 2006</abbr>
  <span class="locality">New York City</span>,  
  <span class="region">NY</span></span></a>,  
  <abbr class="dtstart" title="2006-07-10">July 10</abbr> -  
<abbr class="dtend" title="2006-07-11">11th, 2006</abbr>
</div></nowiki></pre>
</div></nowiki></pre>


Even better, if the location has a name, such as a business or organization, make the location into complete [[hcard|hCard]] rather than just an [[adr]]:
Even better, if the location is a specific venue with a name, such as a business or organization, make the location into a complete [[hcard|hCard]] rather than just an [[adr]]:


<pre><nowiki>
<pre><nowiki>
Line 139: Line 198:
   <span class="location vcard">
   <span class="location vcard">
   <span class="fn org">Scandinavia House</span>,
   <span class="fn org">Scandinavia House</span>,
   <span class="adr"><span class="locality">New York City</span>, <span class="region">NY</span></span>
   <span class="adr">
    <span class="locality">New York City</span>,  
    <span class="region">NY</span></span>
   </span></a>,
   </span></a>,
  <abbr class="dtstart" title="20060710">July 10</abbr>-<abbr class="dtend" title="20060712">11th, 2006</abbr>
  <abbr class="dtstart" title="2006-07-10">July 10</abbr> -  
<abbr class="dtend" title="2006-07-11">11th, 2006</abbr>
</div></nowiki></pre>
</div></nowiki></pre>


Line 151: Line 213:
* How to mark up attendees (including speakers)
* How to mark up attendees (including speakers)
* ...
* ...
== Add subscribe to events link ==
When you update your events to include hCalendar markup, you can also include "Add Events to Calendar" and/or "Subscribe to Events" links for the convenience of your users.
Here are examples of such links:
<pre><nowiki>
<a href="http://h2vx.com/ics/http://microformats.org/wiki/events">
Add Events to Calendar
</a>
</nowiki></pre>
<pre><nowiki>
<a href="webcal://h2vx.com/ics/http://microformats.org/wiki/events">
Subscribe to Events
</a>
</nowiki></pre>
Simply substitute the link to your hCalendar events for the http://microformats.org/wiki/events URL above.
If you want, you can also use Brian Suda's hosted X2V service, or even download and install the X2V XSLT yourself and run it on your own server instead of using an online hCalendar to iCalendar (.ics) converter service.


== Related Pages ==
== Related Pages ==
{{hcalendar-related-pages}}
{{hcalendar-related-pages}}

Revision as of 09:10, 15 June 2015

<entry-title>hCalendar authoring</entry-title>

This page contains useful tips and guidelines for how to author hCalendar events, either from scratch, or by adding markup to existing content.

Goal: The goal of this document is to provide some good intuitive guidelines that should make it as easy and as quick as possible for any web author to create hCalendar events or add hCalendar markup to existing content.

Audience: Web authors and designers. This document is written for easy consumption and understanding by any web designer who knows at least enough (X)HTML and CSS to use HTML class names on elements and write CSS selectors that apply styles to those class names. Please help with clarifying/simplifying this document accordingly.

Author(s): Tantek Çelik

Creating new hCalendar events

Start with the hCalendar creator, and for additional fields and properties (e.g. contact, attendees, etc.), see the hCalendar examples page as well as the rest of this page.

Adding hCalendar markup to existing content

Minimal Markup Changes

The important thing to keep in mind when adding microformats to existing content, is the fact that microformats are designed so that they can be added with minimal (almost always no) changes to the existing presentation of the page. Thus keep this in mind: change as little markup as possible. If you want to fix various pages to be valid XHTML as well, that's a fine goal and highly encouraged.

Find Events

Start with looking for all mentions of events on a page, such as an "Upcoming Events" or "Recent Events" listing. Those are all potential hCalendar events - even more so if they are linked to their respective URLs (e.g. to single event pages with more details).

If an event is mentioned several times on a page, consider marking up an hCalendar event the mention which is the most persistent, detailed, definitive, or otherwise thorough. Ideally you might want to mark up all instances of a events with hCalendar, but for now, just keep it simple and mark up the most representative instance. (Perhaps the most "definitive" instance, which could also then be marked up with a <dfn> element around the summary/title of the event for additional semantic XHTML goodness.)

Determine The Surrounding Element for Each

For each event that you want to add hCalendar, find the smallest element that contains all the info about that event, without overlapping with any other event on the page.

Add the class name "vevent" to that element.

If there is no such element (perhaps the nearest enclosing element contains more than one event), then add a <span class="vevent">...</span> or <div class="vevent">...</div> that wraps the info about about that event and just that event.

The rest of the markup for this hCalendar event MUST go inside that element with the class name "vevent".

In all cases, where it says to add an element with class name of "xyz", if you can find an existing element that precisely surrounds the necessary content, then re-use that element and simply add the class name "xyz" to it (by adding it to the class attribute on the existing element, or by adding a new class attribute class="xyz" to elements without a class attribute).

For instance, assuming you have the following markup:

<div class="someFoo">
  <p> This is my markup, it contains some event information</p>
  <h6>Some Wonderful Event</h6>
  <p> From the people who brought you Great Times and Fun Lovin, 
      comes the Some Wonderful Event at the Local Sports Stadium.  
      Come at <b>A Specified Time</b>, and enjoy yourself! </p>
</div>

If you need to add an element with the class of "vevent" around your event content, you could re-use the existing div element, and add the class "vevent" to it like so:

<div class="someFoo vevent">

Similarly, if you decide not to re-purpose an existing container, you can just wrap the content around a new block:

<div class="someFoo">
  <div class="vevent">
    <p> This is my wond...
        ...
        ... and enjoy yourself! </p>
  </div>
</div>

The Importance of Time and Topic

Several properties are required in hCalendar. At a minimum, an event needs a "summary" (AKA title) and "dtstart" (starting date time), as well as either a "dtend" (ending date time) or "duration". Thus be sure to mark up the name/summary/title of the event with the class name "summary". E.g.

<div class="vevent">
 <span class="summary">An Event Apart, New York City, NY</span>,
 <abbr class="dtstart" title="2006-07-10">July 10</abbr> -
 <abbr class="dtend" title="2006-07-11">11th, 2006</abbr>
</div>

This event might be presented like:

An Event Apart, New York City, NY, July 10 - 11th, 2006

Note: the use of the abbr element's title attribute to mark up a machine readable absolute datetime in addition to the human readable text.

Separate dates and times

Sometimes pages show the date of an event and its times separately, perhaps for stylistic or layout reasons, e.g. the SPHCM Events Calendar puts the date in a heading, and the times following it in another div:

...
<h3>October 2</h3>
<div>3:30 pm - 4:50 pm</div>
...

In such cases, rather than having to redo the markup (which may be serving other purposes) to combine the start date and time into a single element, use a wrapping div to mark up the date and start time with dtstart and a span for just the end time with dtend, e.g.: (whitespace added for readability)

...
<div class="dtstart">
 <h3><abbr class="value" title="2007-10-02">October 2</abbr></h3>
 <div>
  <span class="value">3:30 pm</span> - <span class="dtend">4:50 pm</span>
 </div>
</div>
...

This example makes use of the value-class-pattern, specifically both the date and time separation and implied dtend date techniques.

Completed event example with date and times:

<div class="vevent">
  <h2 class="summary">Seminar on authoring vs examples</h2>
  <div class="dtstart">
    <h3><abbr class="value" title="2007-10-02">October 2</abbr></h3>
    <div>
      <span class="value">3:30 pm</span> - <span class="dtend">4:50 pm</span>
    </div>
  </div>
</div>

Here's another event with the times preceding the date, and location information as well:

<div class="vevent">
  <div class="summary">How to take care of your markup</div>
  <div class="dtstart">
    Date: <span class="value">9am</span> - <span class="dtend">11am</span>, 
    <abbr class="value" title="2011-09-15">9/15/2011</abbr>
  </div>
  <div>Location: <span class="location">123 Main st., Beaverton, OR</span></div>
</div>

Note that the location can be further marked up with the adr microformat. See the Location Examples section below for more details.


Eliminating Default Dotted Underline

Some browsers (Camino, Firefox, Mozilla) put a dotted underline or border on each abbr. You can use the following rule in your style sheet to eliminate this default presentation.

.vevent abbr{border:0}

In the above An Event Apart example, this would have the following effect (which may not look any different for some readers):

An Event Apart, New York City, NY, July 10 - 11th, 2006

Representative URLs

One of the most common patterns for events in web content is to link them to their definitive/preferred web site.

"Event Rolls" are a good example of this (see also XOXO for proper semantic list and outline markup).

Since the class attribute takes a space separated set of class names, one can often mark up the URL on the same element as the name, e.g. by replacing the first <span> in the above example with an <a href> hyperlink:

<div class="vevent">
 <a href="http://aneventapart.com/events/2006/nyc/" class="summary url">An Event Apart, New York City, NY</a>,
 <abbr class="dtstart" title="2006-07-10">July 10</abbr> - 
 <abbr class="dtend" title="2006-07-11">11th, 2006</abbr>
</div>

This event might be presented like:

An Event Apart, New York City, NY, July 10 - 11th, 2006

Location Location Location

As with real estate, the location of an event is quite relevant, and important to mark up properly. At a minimum, identify the location related information in the event and mark it up with the class name of "location", e.g. continuing with the above example:

<div class="vevent">
 <a href="http://aneventapart.com/events/2006/nyc/" class="summary url">An Event Apart, 
  <span class="location">New York City, NY</span></a>, 
 <abbr class="dtstart" title="2006-07-10">July 10</abbr> -
 <abbr class="dtend" title="2006-07-11">11th, 2006</abbr>
</div>

This is good, but can be made even better with the addition of the adr microformat to explicitly identify the city and state:

<div class="vevent">
 <a href="http://aneventapart.com/events/2006/nyc/" class="summary url">An Event Apart, 
  <span class="location adr">
   <span class="locality">New York City</span>, 
   <span class="region">NY</span></span></a>, 
 <abbr class="dtstart" title="2006-07-10">July 10</abbr> - 
 <abbr class="dtend" title="2006-07-11">11th, 2006</abbr>
</div>

Even better, if the location is a specific venue with a name, such as a business or organization, make the location into a complete hCard rather than just an adr:

<div class="vevent">
 <a href="http://aneventapart.com/events/2006/nyc/" class="summary url">An Event Apart, 
  <span class="location vcard">
   <span class="fn org">Scandinavia House</span>,
   <span class="adr">
    <span class="locality">New York City</span>, 
    <span class="region">NY</span></span>
  </span></a>,
 <abbr class="dtstart" title="2006-07-10">July 10</abbr> - 
 <abbr class="dtend" title="2006-07-11">11th, 2006</abbr>
</div>

More tips and guidelines

Feel free to add more tips that experience has taught you while marking up events with hCalendar, even if all you add is a brief catch phrase that reminds you.

  • How to mark up the contact and organizer
  • How to mark up attendees (including speakers)
  • ...

Add subscribe to events link

When you update your events to include hCalendar markup, you can also include "Add Events to Calendar" and/or "Subscribe to Events" links for the convenience of your users.

Here are examples of such links:

<a href="http://h2vx.com/ics/http://microformats.org/wiki/events">
Add Events to Calendar
</a>
<a href="webcal://h2vx.com/ics/http://microformats.org/wiki/events">
Subscribe to Events
</a>

Simply substitute the link to your hCalendar events for the http://microformats.org/wiki/events URL above.

If you want, you can also use Brian Suda's hosted X2V service, or even download and install the X2V XSLT yourself and run it on your own server instead of using an online hCalendar to iCalendar (.ics) converter service.

Related Pages

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.