[uf-new] collection-design-pattern proposal

Danny Ayers danny.ayers at gmail.com
Wed Apr 25 01:50:53 PDT 2007


On 25/04/07, Manu Sporny <msporny at digitalbazaar.com> wrote:
> Danny Ayers wrote:
> > It just occurred to me that the cleanest way of doing this would be
> > simply to use the HTML class attribute directly, the spec seems to
> > comfortably cover class as Set. The only drawback here is that there
> > isn't much in the way of conventions for talking about the named Set
> > (though such conventions are possible through meta data profiles).
>
> Danny, could you please give an example to clarify?

Starting from your example:

<div class="haudio grouping.reconnection">
  <span class="collaborator hcard fn">Ammonite</span>
  <span class="work-title">Reconnection</span>
</div>
[...]
<div class="haudio grouping.reconnection.sunset">
  <span class="work-title">Sunset</span>
</div>

it could be simplified to:

<div class="haudio">
  <span class="collaborator hcard fn">Ammonite</span>
  <span class="work-title">Reconnection</span>
</div>
[...]
<div class="haudio reconnection">
  <span class="work-title">Sunset</span>
</div>

"grouping" isn't needed, because class already expresses a kind of set
membership. There is still the problem of how to connect the item to
its container, easiest would be:

<div class="haudio" id="reconnection">
  <span class="collaborator hcard fn">Ammonite</span>
  <span class="work-title">Reconnection</span>
</div>
[...]
<div class="haudio reconnection">
  <span class="work-title">Sunset</span>
</div>

However personally I think I'd go a step further and make everything
more explicit, to avoid the parser having to do infer the association:

<div class="haudio" id="reconnection">
  <span class="collaborator hcard fn">Ammonite</span>
  <span class="work-title">Reconnection</span>
</div>
[...]
<div class="haudio reconnection">
  <span class="work-title">Sunset</span>
  Part of <span class="part-of"><a name="#reconnection">Reconnection</a></span>
</div>

Cheers,
Danny.

-- 

http://dannyayers.com


More information about the microformats-new mailing list