MEP-0011

Roles on Sort Titles

This page proposes allowing a role attribute on informational sort titles. The appropriate sort title would be selected similarly to how link titles are selected with roles.

Authors: Shaun McCance
Created: 2017-08-31
Status: revised (2019-11-17)
Target: 1.2
Depends:
Issue: https://github.com/projectmallard/projectmallard.org/issues/1
History:
show history
hide history
history
2017-08-31 1.1 proposed
2018-03-14 1.2 proposed
2019-11-17 1.2 revised Use MEP-0018

This proposal is still under consideration. Revisions may still be made based on your input. Discuss this proposal on mallard-list.

Background

Mallard allows multiple informational titles for various purposes. One type of informational title is the title to be used when sorting links to pages or sections. For example, you can use sort titles to sort without leading articles such as “an” and “the”.

Another type of informational title is the title used for link text when linking to a page or section. You can actually provide multiple link titles, each with a different role attribute. The correct title is selected based on a role attribute on an inline link element or an implicit role specified by a type of automatic link. MEP-0003 also allows you to explicitly select a role with a links element.

Unfortunately, no matter which link title is used for the link text, the same sort title is always used.

Proposal

This page proposes making the role attribute relevant for sort titles. In Mallard 1.0, the role attribute is already valid, because the schemas don’t distinguish between link types. However, the role attribute is only used for link types that are specified.

Whenever links are collected and need to be sorted, they would be sorted according to the sort title. The sort title would be looked up according to the lookup rules in MEP-0018: Type-and-Role Data, using the type sort and a role list containing any explicit role set using the role attribute followed by any implicit role based on the type of the links element. This is effectively the same set of lookup rules as used for link text, but using sort instead of link as the type.

With this proposal, sort titles would no longer fall back to link titles. This is a potential compatibility issue. However, with this proposal, sort and link titles for a given role can be set with a single element by omitting the type attribute. Users that have complex sort and link title needs, and who need to work with both older and newer tools, would need to be careful to be explicit with titles.

Examples

This section is not yet written. Discuss this proposal on mallard-list.

Internationalization

This section is not yet written. Discuss this proposal on mallard-list.

Alternatives

This proposal was originally written before the common lookup rules were proposed in MEP-0018: Type-and-Role Data. This proposal originally had its own specified sort title lookup rules. These rules were similar to the common rules in MEP-0018, but not exactly the same.

Compatibility and Fallback

This proposal makes a backwards-incompatible change to the behavior when no sort title is present. In Mallard 1.0, sort titles would use the entire link title lookup rules. With this proposal, if a sort title is not specified, it simply falls back to the primary title.

If a page with multiple sort titles is processing by a tool that does not implement this proposal, that tool will select one of those sort titles, and there is no guarantee as to which one. In practice, all known implementations select the first sort title when multiple sort titles are available. For this reason, when writers use multiple sort titles, they should place the sort title without a role before other sort titles in the info element.

Comparison to Other Formats

No other format has a comparable mechanism for selecting the title to use for link text. Also, the links element is particular to the unique automatic linking mechanism in Mallard. No comparison can be made to other formats for this proposal.

© 2017-2019 Shaun McCance
cc-by-sa 3.0 (us)

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

As a special exception, the copyright holders give you permission to copy, modify, and distribute the example code contained in this document under the terms of your choosing, without restriction.

Powered by
Mallard