hcalendar-authoring-fr
publication hCalendar
Cette page contient quelques trucs et instructions utiles pour savoir comment publier des événements hCalendar soit à partir de rien, ou en ajoutant du balisage à un contenu existant.
But : Le but de ce document est de fournir quelques instructions intuitives qui devraient faire qu'il soit aussi facile et aussi rapide que possible pour n'importe quel auteur web de créer des événements hCalendar ou d'ajouter du balisage hCalendar à un contenu existant.
Audience : auteurs web et designers. Ce document est écrit pour une consommation et une compréhension facile par n'importe quel designer web qui connaît au moins assez (X)HTML et CSS pour utiliser les noms de classe HTML sur les éléments et écire des sélecteurs CSS qui appliquent des styles à ces noms de classes. SVP aidez à clarifier / simplifier ce document.
Auteur(s) : Tantek Çelik
(traduction en cours Christophe Ducamp)
Créer des nouveaux événéments hCalendar
Commencez avec le hCalendar creator, et pour les champs additionnels (par ex. contact, participants, etc.), voir la page exemples hCalendar tout comme le reste de cette page.
Ajouter du balisage hCalendar à du contenu existant
Changements minimaux de syntaxe
Le chose importante à garder en tête au moment d'ajouter des microformats à du contenu existant, est le fait que les microformats sont conçus de telle manière qu'ils puissent être ajoutés avec des changements minimaux (presque toujours aucun) à la présentation existante de la page. De ce fait, gardez ça en tête : changez aussi peu de balisage que possible. Si vous voulez aussi préparer différentes pages pour qu'elles soient valides XHTML, c'est un très joli but et hautement encouragé.
Trouver les Events
Commencez par regarder toutes les mentions des événements sur une page, telle qu'une liste d'"Evénements à Venir" ou d'"Evénements Récents". Ce sont tous des 'events' potentiels hCalendar. Même plus s'ils sont liés vers leurs URLs repsectifs (par ex. par page événement avec plus de détails).
Si un événement est mentionné plusieurs fois sur une page, considérez de baliser la mention qui est la plus pertinente, détaillée, définitive, ou autrement complète comme un événement hCalendar. Idéalement, vous pourriez vouloir baliser toutes les instances d'un événements avec hCalendar, mais à ce stade, faites simple et balisez l'instance la plus représentative. (Peut-être que l'instance la plus "définitive", qui pourrait être ensuite balisée avec un élément <dfn>
autour du 'summary/title' de l'événement pour le bien d'un XHTML sémantique additionnel.)
Déterminer l'Elément entourant pour Chacun
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 wonderful markup, it contains some event information inside of it</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>
L'Importance du Temps et du Sujet
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="20060710">July 10</abbr>-<abbr class="dtend" title="20060712">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 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 and hcalendar-example1-steps for more details on the use of the abbr element in this fashion.
Eliminer le Souligné Pointillé par Défaut
Some browsers (Camino, Firefox, Mozilla) put a dotted underline or border on each 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.
abbr{border:0}
In the above 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
URLs représentatives
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 markup 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="20060710">July 10</abbr>-<abbr class="dtend" title="20060712">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 markup properly. At a minimum, identify the location related information in the event and mark it up with the class name of "locatioin", 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="20060710">July 10</abbr>-<abbr class="dtend" title="20060712">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="20060710">July 10</abbr>-<abbr class="dtend" title="20060712">11th, 2006</abbr> </div>
Even better, if the location has a name, such as a business or organization, make the location into 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="20060710">July 10</abbr>-<abbr class="dtend" title="20060712">11th, 2006</abbr> </div>
Plus de trucs et d'instructions
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)
- ...