hcalendar-authoring: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
No edit summary
m (Replace <entry-title> with {{DISPLAYTITLE:}})
 
(18 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[[http://cannotspell.ifrance.com/description/lib/katsumi/ katsumi]] [[http://rielethuil.ifrance.com/description/lib/nightmare-before.htm nightmare before christmas tim burton]] [[http://cannotspell.ifrance.com/description/lib/olimpus-e/ olimpus e1]] [[http://last-shadow.ifrance.com/text/directory/giardino-arredamento/ giardino arredamento]] [[http://heyclassylady.ifrance.com/html/km-.htm km 0 rm]] [[http://uo-ination.ifrance.com/lib/fase-laserdisc/ fase laserdisc]] [[http://me4tateljnitsa.ifrance.com/data/traduzione-della/ traduzione della canzone dragostea din t]] [[http://butanexlove.ifrance.com/lib/chatear.htm chatear]] [[http://epireial-h.ifrance.com/topic/jeti-sport.htm jeti sport 1]] [[http://bagrec.ifrance.com/lib/massimo-di.htm massimo di cataldo]] [[http://fishing-gro.ifrance.com/html/mercedes-e/ mercedes e 280]] [[http://last-shadow.ifrance.com/text/directory/traxdata-/ traxdata  kit di pulizia]] [[http://cannotspell.ifrance.com/description/lib/militari-decapitati/ militari decapitati]] [[http://pegasik.ifrance.com/html/gallerie-fotografiche/ gallerie fotografiche porno gratis]] [[http://lauashbu.ifrance.com/lib/regolamento-condominio/ regolamento condominio]] [[http://epireial-h.ifrance.com/topic/supermen-merlin.htm supermen merlin joksimovic]] [[http://butanexlove.ifrance.com/lib/impianto-luci.htm impianto luci]] [[http://bagrec.ifrance.com/lib/discariche-compattazione.htm discariche compattazione]] [[http://stasiia.ifrance.com/img/styles/televisori-/ televisori  plasma 32]] [[http://rielethuil.ifrance.com/description/lib/pentium.htm pentium 3 2]] [[http://orbzine.ifrance.com/images/small/cavo-dati.htm cavo dati siemens s55]] [[http://rielethuil.ifrance.com/description/lib/frigoriferi-combinati.htm frigoriferi combinati a]] [[http://butanexlove.ifrance.com/lib/nike-duro.htm nike duro]] [[http://orbzine.ifrance.com/images/small/video-scandalo.htm video scandalo vip]] [[http://fishing-gro.ifrance.com/html/la-grande/ la grande rivolta]] [[http://lauashbu.ifrance.com/lib/san-jose/ san jose intrattenimento]] [[http://pegasik.ifrance.com/html/frocetto/ frocetto]] [[http://la-seras.ifrance.com/library/html/madeas-family.htm madeas family reunion]] [[http://sherryfraser03.ifrance.com/web/portatili-athlon/ portatili athlon 64]] [[http://zonkismusik.ifrance.com/img/styles/chicken-.htm chicken  little]] [[http://stasiia.ifrance.com/img/styles/promo-studio/ promo studio mae]] [[http://heyclassylady.ifrance.com/html/freelander-sicilia.htm freelander sicilia]] [[http://epireial-h.ifrance.com/topic/baltag-cezar.htm baltag cezar]] [[http://rielethuil.ifrance.com/description/lib/quadro-fx.htm quadro fx 4400]] [[http://sherryfraser03.ifrance.com/web/ragazzo-parigi/ ragazzo parigi]] [[http://fishing-gro.ifrance.com/html/suono-monitor/ suono monitor]] [[http://heyclassylady.ifrance.com/html/fujifilm-s.htm fujifilm s3 pro]] [[http://heyclassylady.ifrance.com/html/dfi-nfslidr.htm dfi nf4slidr]] [[http://me4tateljnitsa.ifrance.com/data/foto-pazze/ foto pazze]] [[http://bagrec.ifrance.com/lib/telefono-erotico.htm telefono erotico 899]] [[http://gmkamm.ifrance.com/view/new/roy-orbison.htm roy orbison live at austin city limits augusts 1982]] [[http://bagrec.ifrance.com/lib/hdtv-ready.htm hdtv ready]] [[http://bagrec.ifrance.com/lib/looney-.htm looney  tunes]] [[http://lauashbu.ifrance.com/lib/liquid-edition/ liquid edition 6]] [[http://lauashbu.ifrance.com/lib/circle-jerks/ circle jerks live at the house of blues]] [[http://lady-mosquito.ifrance.com/web/produzione-sauna/ produzione sauna]] [[http://stasiia.ifrance.com/img/styles/ventilatori-soffitto/ ventilatori soffitto argento]] [[http://ryandrablya.ifrance.com/lib/pastiglia-dimagrire.htm pastiglia dimagrire]] [[http://ryandrablya.ifrance.com/lib/da-qualche.htm da qualche parte]] [[http://pegasik.ifrance.com/html/le-coode/ le coode de canal fr]] [[http://pegasik.ifrance.com/html/matematica-per/ matematica per la gestione finanziaria]] [[http://uo-ination.ifrance.com/lib/liza-minnelli/ liza minnelli]] [[http://stasiia.ifrance.com/img/styles/audiokey/ audiokey 512]] [[http://pegasik.ifrance.com/html/dvbt-pci/ dvbt pci ci]] [[http://heyclassylady.ifrance.com/html/aladdin-trilogy.htm aladdin trilogy]] [[http://la-seras.ifrance.com/library/html/landa.htm landa]] [[http://gmkamm.ifrance.com/view/new/istituto-s.htm istituto s pio x]] [[http://ryandrablya.ifrance.com/lib/reclame-champions.htm reclame champions league]] [[http://sherryfraser03.ifrance.com/web/mp-cro/ mp3 cro]] [[http://orbzine.ifrance.com/images/small/xbox-pc.htm xbox pc pc]] [[http://zonkismusik.ifrance.com/img/styles/scheda-video.htm scheda video in out pci]] [[http://la-seras.ifrance.com/library/html/hosseini-libri.htm hosseini libri]] [[http://butanexlove.ifrance.com/lib/piumino-pelo.htm piumino pelo]] [[http://sherryfraser03.ifrance.com/web/muzica-romania/ muzica romania]] [[http://cannotspell.ifrance.com/description/lib/ingegnere-decapitato/ ingegnere decapitato]] [[http://zonkismusik.ifrance.com/img/styles/ariete-espresso.htm ariete espresso]] [[http://epireial-h.ifrance.com/topic/pistas-de.htm pistas de reggeton gratis]] [[http://sherryfraser03.ifrance.com/web/sex-orale/ sex orale]] [[http://me4tateljnitsa.ifrance.com/data/club-prive/ club prive in abruzzo]] [[http://rielethuil.ifrance.com/description/lib/discografia-gianni.htm discografia gianni celeste]] [[http://uo-ination.ifrance.com/lib/chiarine/ chiarine]] [[http://pegasik.ifrance.com/html/mauro-caputo/ mauro caputo]] [[http://gmkamm.ifrance.com/view/new/gioventu-fascista.htm gioventu fascista]] [[http://pegasik.ifrance.com/html/everybody-s/ everybody s got to learn sometime beck]] [[http://stasiia.ifrance.com/img/styles/kill-bill/ kill bill dvd]] [[http://cannotspell.ifrance.com/description/lib/adattatore-usb/ adattatore usb firewire]] [[http://heyclassylady.ifrance.com/html/troie-pompini.htm troie pompini chiavare sborrate gratis]] [[http://pegasik.ifrance.com/html/un-medico/ un medico in famiglia prima serie vol 14]] [[http://pegasik.ifrance.com/html/computer-palmare/ computer palmare]] [[http://me4tateljnitsa.ifrance.com/data/backstage-calendario/ backstage calendario carolina marconi]] [[http://lauashbu.ifrance.com/lib/samanta-de/ samanta de grenet]] [[http://zonkismusik.ifrance.com/img/styles/farry-boat.htm farry boat]] [[http://zonkismusik.ifrance.com/img/styles/wili.htm wili]] [[http://uo-ination.ifrance.com/lib/valentino-occhiali/ valentino occhiali donna da sole]] [[http://bagrec.ifrance.com/lib/il-trenino.htm il trenino thomas]] [[http://sherryfraser03.ifrance.com/web/manuela-do/ manuela do bbb 4]] [[http://gmkamm.ifrance.com/view/new/brescia-e.htm brescia e provincia]] [[http://la-seras.ifrance.com/library/html/ombre-sul.htm ombre sul cuore]] [[http://me4tateljnitsa.ifrance.com/data/km-/ km 0 seat ibiza]] [[http://sherryfraser03.ifrance.com/web/plagi-musicali/ plagi musicali]] [[http://lady-mosquito.ifrance.com/web/every-body/ every body got to learn sometime]] [[http://fishing-gro.ifrance.com/html/ospedali-di/ ospedali di roma]] [[http://heyclassylady.ifrance.com/html/www-trepuzzi.htm www trepuzzi it]] [[http://bagrec.ifrance.com/lib/erosramazotti.htm erosramazotti]] [[http://cannotspell.ifrance.com/description/lib/royal-canin/ royal canin boxer]] [[http://uo-ination.ifrance.com/lib/marchio-ce/ marchio ce]] [[http://sherryfraser03.ifrance.com/web/adattatore-di/ adattatore di corrente usb]] [[http://rielethuil.ifrance.com/description/lib/giochi-europei.htm giochi europei 2004]] [[http://lauashbu.ifrance.com/lib/furia-gialla/ furia gialla]] [[http://rielethuil.ifrance.com/description/lib/powter-daniel.htm powter daniel]] [[http://me4tateljnitsa.ifrance.com/data/intolleranza/ intolleranza]] [[http://gmkamm.ifrance.com/view/new/mercedes-c.htm mercedes c 270 cdi sw]] [[http://orbzine.ifrance.com/images/small/parafrasi-andreuccio.htm parafrasi andreuccio da perugia]] [[http://epireial-h.ifrance.com/topic/so-dimm.htm so dimm 100]] [[http://rielethuil.ifrance.com/description/lib/hotel-albergo.htm hotel albergo lido jesolo]] [[http://cannotspell.ifrance.com/description/lib/bell-imedia/ bell imedia]] [[http://uo-ination.ifrance.com/lib/tablature-basso/ tablature basso rasmus]] [[http://cannotspell.ifrance.com/description/lib/note-cuf/ note cuf 1]] [[http://cannotspell.ifrance.com/description/lib/nike-felpe/ nike felpe]] [[http://bagrec.ifrance.com/lib/paludan-jakob.htm paludan jakob]] [[http://last-shadow.ifrance.com/text/directory/philips-nike/ philips nike]] [[http://bagrec.ifrance.com/lib/hotel-capital.htm hotel capital iesolo]] [[http://lauashbu.ifrance.com/lib/ducati-monster/ ducati monster 600 dark]] [[http://zonkismusik.ifrance.com/img/styles/fritz-lang.htm fritz lang]] [[http://me4tateljnitsa.ifrance.com/data/morbo-di/ morbo di evans]] [[http://fishing-gro.ifrance.com/html/bob/ bob2006]] [[http://cannotspell.ifrance.com/description/lib/scegliere-conto/ scegliere conto corrente]] [[http://uo-ination.ifrance.com/lib/thuthuca/ thuthuca]] [[http://ryandrablya.ifrance.com/lib/lavastoviglie-incasso.htm lavastoviglie incasso 45]] [[http://cannotspell.ifrance.com/description/lib/friends-stagione/ friends stagione 7]] [[http://sherryfraser03.ifrance.com/web/sexso-de/ sexso de colegialas]] [[http://stasiia.ifrance.com/img/styles/musiche-viennesi/ musiche viennesi]] [[http://orbzine.ifrance.com/images/small/coppia-romana.htm coppia romana consolidata]] [[http://zonkismusik.ifrance.com/img/styles/ronald-colman.htm ronald colman]] [[http://pegasik.ifrance.com/html/monitor-lcd/ monitor lcd 17 dvi 8ms]] [[http://bagrec.ifrance.com/lib/princess-dianan.htm princess dianan]] [[http://cannotspell.ifrance.com/description/lib/rana-golia/ rana golia]] [[http://heyclassylady.ifrance.com/html/idraulica-como.htm idraulica como]] [[http://bagrec.ifrance.com/lib/polti-eco.htm polti eco 3000]] [[http://me4tateljnitsa.ifrance.com/data/ford-c/ ford c max]] [[http://zonkismusik.ifrance.com/img/styles/pijane-foto.htm pijane foto]] [[http://sherryfraser03.ifrance.com/web/motocros/ motocros]] [[http://bagrec.ifrance.com/lib/spartiti-de.htm spartiti de crescenzo]] [[http://gmkamm.ifrance.com/view/new/comune-poggio.htm comune poggio sanita]] [[http://butanexlove.ifrance.com/lib/cercasi-casa.htm cercasi casa a manhattan]] [[http://gmkamm.ifrance.com/view/new/olimpiadi-ginnastica.htm olimpiadi ginnastica ritmica]] [[http://lady-mosquito.ifrance.com/web/dx-nikon/ d2x nikon]] [[http://pegasik.ifrance.com/html/comune-di/ comune di montecatini]] [[http://orbzine.ifrance.com/images/small/ma-se.htm ma se ghe pensu]] [[http://orbzine.ifrance.com/images/small/jojo-leave.htm jojo leave mp3]] [[http://butanexlove.ifrance.com/lib/aira.htm aira]] [[http://la-seras.ifrance.com/library/html/all-the.htm all the rooms]] [[http://bagrec.ifrance.com/lib/grossisti-calze.htm grossisti calze e collant]] [[http://sherryfraser03.ifrance.com/web/wil-/ wil 146 sp (it) (co)]] [[http://zonkismusik.ifrance.com/img/styles/telecamere-mini.htm telecamere mini dvd]] [[http://heyclassylady.ifrance.com/html/carra-maracaibo.htm carra maracaibo testo]] [[http://gmkamm.ifrance.com/view/new/hard-nonne.htm hard nonne con voglia di scopare]] [[http://la-seras.ifrance.com/library/html/sviluppo-fotografia.htm sviluppo fotografia digitali]] [[http://gmkamm.ifrance.com/view/new/ragazze-scollate.htm ragazze scollate]] [[http://bagrec.ifrance.com/lib/concessionari-toyota.htm concessionari toyota milano]] [[http://zonkismusik.ifrance.com/img/styles/bel-vita.htm bel vita]] [[http://cannotspell.ifrance.com/description/lib/morte-di/ morte di berg]] [[http://zonkismusik.ifrance.com/img/styles/ragazzo-sestri.htm ragazzo sestri levante]] [[http://ryandrablya.ifrance.com/lib/cosmetologia.htm cosmetologia]] [[http://la-seras.ifrance.com/library/html/il-mondo.htm il mondo fontana]] [[http://lauashbu.ifrance.com/lib/dowson-creeck/ dowson creeck]] [[http://pegasik.ifrance.com/html/hot-whells/ hot whells]] [[http://gmkamm.ifrance.com/view/new/occhiali-da.htm occhiali da sole versace]] [[http://stasiia.ifrance.com/img/styles/www-xxltv/ www xxltv net]] [[http://orbzine.ifrance.com/images/small/twain-mark.htm twain mark]] [[http://la-seras.ifrance.com/library/html/pantalone.htm pantalone]] [[http://gmkamm.ifrance.com/view/new/romanzo-criminale.htm romanzo criminale libri]] [[http://lauashbu.ifrance.com/lib/coppia-con/ coppia con singolo]] [[http://sherryfraser03.ifrance.com/web/painted-on/ painted on my heart]] [[http://bagrec.ifrance.com/lib/foto-tagli.htm foto tagli di capelli]] [[http://heyclassylady.ifrance.com/html/soldier-fortune.htm soldier fortune]] [[http://uo-ination.ifrance.com/lib/il-vangelo/ il vangelo secondo precario]] [[http://zonkismusik.ifrance.com/img/styles/lc-power.htm lc power 480w]] [[http://bagrec.ifrance.com/lib/camper-usato.htm camper usato lombardia]] [[http://uo-ination.ifrance.com/lib/moguai/ moguai]] [[http://fishing-gro.ifrance.com/html/scanner-epson/ scanner epson perfection 4990]] [[http://stasiia.ifrance.com/img/styles/prodotti-tipico/ prodotti tipico gastronomia]] [[http://epireial-h.ifrance.com/topic/re.htm re 100]] [[http://orbzine.ifrance.com/images/small/circolari-lavoro.htm circolari lavoro]] [[http://heyclassylady.ifrance.com/html/modem-router.htm modem router 3com]] [[http://last-shadow.ifrance.com/text/directory/power-injector/ power injector]] [[http://gmkamm.ifrance.com/view/new/ritmo.htm ritmo 2]] [[http://heyclassylady.ifrance.com/html/ricevitore-gps.htm ricevitore gps tom tom 5]] [[http://sherryfraser03.ifrance.com/web/monitor-lcd/ monitor lcd 40]] [[http://rielethuil.ifrance.com/description/lib/cera-per.htm cera per marmo]] [[http://lady-mosquito.ifrance.com/web/offerta/ offerta 2]] [[http://sherryfraser03.ifrance.com/web/dibujos-de/ dibujos de dragon ball z]] [[http://gmkamm.ifrance.com/view/new/kenwood-km.htm kenwood km 005]] [[http://ryandrablya.ifrance.com/lib/black-e.htm black e decker]] [[http://lady-mosquito.ifrance.com/web/video-alcazar/ video alcazar]] [[http://gmkamm.ifrance.com/view/new/escort-accompagnatrici.htm escort accompagnatrici modena]] [[http://la-seras.ifrance.com/library/html/sesso-oggetto.htm sesso oggetto]] [[http://cannotspell.ifrance.com/description/lib/marc-ribot/ marc ribot]] [[http://fishing-gro.ifrance.com/html/tv-hdtv/ tv hdtv]] [[http://ryandrablya.ifrance.com/lib/le-formiche.htm le formiche black power]] [[http://epireial-h.ifrance.com/topic/audi-a.htm audi a3 2003]] [[http://epireial-h.ifrance.com/topic/registratore-digitale.htm registratore digitale 2300]] [[http://butanexlove.ifrance.com/lib/thailandia.htm thailandia]] [[http://last-shadow.ifrance.com/text/directory/sfondi-per/ sfondi per xp 2]] [[http://ryandrablya.ifrance.com/lib/camion-da.htm camion da gara]] [[http://pegasik.ifrance.com/html/scugnizzi/ scugnizzi]] [[http://me4tateljnitsa.ifrance.com/data/pussy-cum/ pussy cum]] [[http://orbzine.ifrance.com/images/small/velden.htm velden]] [[http://orbzine.ifrance.com/images/small/airone-it.htm airone it]] [[http://epireial-h.ifrance.com/topic/transessuali-foto.htm transessuali foto]] <h1>hCalendar authoring</h1>
{{DISPLAYTITLE:hCalendar authoring}}


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}}

Latest revision as of 16:24, 18 July 2020


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.