Itâs been a busy week for microformats.
Google announced that it was following in the footsteps of Yahooâs SearchMonkey in indexing microformats and RDFa to display in search results. For now, itâs a subset of microformatsâhCard and hReviewâon a subset of websites, including the newly microformated Yelp. The list of approved sites will increase over time so if youâre already publishing structured contact and review information, let Google know about it.
But the other new announcement is equally important. After a lot of hard work, the value class pattern is ready for use.
The what now?
I hear you ask. Well, if youâve been feeling hampered by the combination of the datetime and abbr design patterns, the value class pattern offers a few alternatives.
To my mind, thatâs one of the greatest strengths of the value class pattern: it doesnât offer one alternative, it allows authors to choose how they want to mark up their content. I think thatâs one of the reasons why datetime values have proven to be such a sticking point up âtill now. Concerns about semantics and accessibility really come down to the fact that, as an author, you had very little choice in how you could mark up a datetime value.
You could either present the datetime between the opening and closing tags of whatever element you were using:
<span class="dtstart">
2009-06-05T20:00:00
</span>
â¦or you could put the value in the title attribute of the abbr element:
<abbr class="dtstart" title="2009-06-05T20:00:00">
Friday, June 5th at 8pm
</abbr>
Those were your only options.
But now, with the value class pattern, all of the following are possible:
<span class="dtstart">
<abbr class="value" title="2009-06-05">
Friday, June 5th
</abbr>
at
<abbr class="value" title="20:00">
8pm
</abbr>
</span>
<span class="dtstart">
<span class="value-title" title="2009-06-05T20:00:00">
Friday, June 5th at 8pm
</span>
</span>
<span class="dtstart">
<span class="value-title" title="2009-06-05">
Friday, June 5th
</span>
at
<span class="value-title" title="20:00">
8pm
</span>
</span>
<span class="dtstart">
<span class="value-title" title="2009-06-05T20:00:00"> </span>
Friday, June 5th at 8pm
</span>
Personally, Iâll probably use the first example. I like the idea of splitting up the date and time portions of a datetime value. I think thereâs a big difference between putting a date string into the title attribute of an abbr element and putting a datetime string in there. In the past, when I argued that having an ISO date value in an abbreviation was semantic, accessible and internationalised, Mike Davies rightly accused me of using a strawmanâthe issue wasnât about dates, it was about datetimes. Thatâs why I created the date design pattern page on the microformats wiki; to disambiguate it as a subset of the larger datetime design pattern.
Now, others might think that even using dates in combination with the abbr design pattern is semantically dodgy. Thatâs fine. They now have some other options they can use, thanks to the value-title subset of the value class pattern. Me? I donât see myself using that. Iâm especially not keen on the option to use an empty element. But Iâm perfectly happy for other authors to go ahead and use that option. When it comes to writing, there are often no right or wrong answers, just personal preferences. Thatâs true whether itâs English, HTML, or any other language. As long as you use correct syntax and grammar, the details are up to you. You can choose semicolons or em-dashes when youâre writing English. You can choose abbr or value-title when youâre writing microformats.
The wiki page for the value class pattern doesnât just list the options available to authors. It also explains them. Thatâs just as important. Head over there and read the document. I think youâll agree that itâs an excellent example of clear, methodical writing.
The microformats wiki needs more pages like that. One of the biggest challenges facing microformats isnât any particular technical problem; itâs trying to explain to willing HTML authors how to get up and running with microformats. Given Googleâs recent announcement, thereâll probably be even more eager authors showing up, looking to sprinkle some extra semantics into their markup. Weâll be hanging out in the IRC channel, ready to answer any questions people might have, but I wish the wiki were laid out in a more self-explanatory way.
In the face of that challenge, the page for the value class pattern leads by example. Ben and Tantek have done a fantastic job. And it wouldnât have been possible without the help and support of Bruce, James and Derek, those magnanimous giants of the accessibility community who offered help, support and data.