Proposal for type-and-role data

Shaun McCance <shaunm at gnome.org>
Sun Nov 10 08:42:30 EST 2019

Comment below:

On Sun, 2019-09-01 at 12:02 -0400, Shaun McCance wrote:
> Here's what I came up with: To get the title/desc/thumb for a type
> $type and a list of roles $roles:
> 
> 1) For each $role in $roles, if there exists an info title/desc/thumb
> with the type attribute set to $type and the role attribute set to
> $role, use that title/desc/thumb and skip the rest.
> 
> 2) If there exists a title/desc/thumb with the type attribute set to
> $type and without a role attribute, use that.
> 
> 3) For each $role in $roles, if there exists an info title/desc/thumb
> with no type attribute and with the role attribute set to $role, use
> that title/desc/thumb and skip the rest.
> 
> 4) If there exists a title/desc/thumb without a type attribute and
> without a role attribute, use that.
> 
> 5) Finally, if you're looking for a title, go ahead and use the
> primary
> display title (outside the info element) if nothing else matches.
> 
> This does change the current link title lookup, but only by adding
> titles without type attributes as extra fallbacks. I don't see any
> real
> compatibility issues. I think there's an argument for swapping steps
> 2
> and 3. Basically, is type more important or role?

I was writing a MEP for this, and rewriting MEP-0004, MEP-0008, and
MEP-0011 to use it, and I convinced myself the role should take
precedence over type. Here's why:

With these new lookup rules, sort titles will no longer fall back to
link titles, unless we add special rules for sort titles, and I want to
avoid special rules. But, you can just set the sort and link titles for
a role in one go, just like this:

<title role="topic">My Topic Title</title>

Once 1.2 adoption is widespread, I expect this to be the way people do
alternative titles by default. But now imagine you use a sans-role sort
title to sort the normal title, along with this with-role title:

<info>
  <title role="topic">My Topic Title</title>
  <title type="sort">Normal Title</title>
</info>
<title>The Normal Title</title>

The rules I listed above would have topic links display "My Topic
Title" but sort by "Normal Title". I think the intent is clearly that
topic links should both display and sort by "My Topic Title", and that
"Normal Title" is just the sort title for "The Normal Title".

So, I'm swapping steps 2 and 3, unless somebody has an argument the
other way.

Thanks,
Shaun