Page MenuHomePhabricator

Resolve inconsistent numbering of references in text and in bibliography
Open, LowPublic

Description

For the sake of this task, "in text" refers to the appearance of citations where they are used (i.e. the output of the <ref> tags), and "bibliography" refers to the listing of all references at the bottom of the page (i.e. the output of the <references> tags).

Screen Shot 2018-06-23 at 4.08.54 PM.png (438×704 px, 77 KB)

Cite currently allows for the references in text to have various numbering schemes. This is achieved through the use of group parameter along with defining an appropriate system message called MediaWiki:Cite link label group-* where * is replaced with that group's name. For instance, on English Wikipedia, MediaWiki:Cite link label group-lower-alpha contains the definition of a custom numbering scheme that allows for the references in text to be numbered as a, b, c, ... instead of the usual 1, 2, 3, .... Below, you can see some wikicode followed by its output in English Wikiedpia:

Some text<ref>Foo bar, 1998</ref> some other text.<ref>Lorem ipsum, 2018</ref> Text that needs explanation.<ref group="lower-alpha">Explanation</ref>

; Footnotes
<references group="lower-alpha"/>

; References
<references/>

Screen Shot 2018-06-23 at 4.png (161×397 px, 13 KB)

Unlike the references in text, for which Cite generates the numbering as <a> tags and determines their numbering as specified above, the bibliography is produced as an ordered list (an <ol> tag) and the numbering of its list items (<li> tags) is determined by the browser and/or the CSS. As a result, there will be mismatches between how citations appear in text and in the bibliography. In the example above, the third citation in text is numbered as "a", but in the bibliography it is numbered as "1".

To solve this, an appropriate CSS style needs to be applied to the right <ol> element.

  • The CSS style might already exists, or might need to be created. In the example above, setting list-style-type: lower-alpha may take cafe of the issue. In other cases, first a counter-style needs to be defined, and then applied to the <ol> element.
  • It is worth emphasizing that the style needs to be applied to the *right* <ol> element. Since a page might contain multiple sets of references, and some might share the same numbering scheme, identifying which <ol> element needs to be targeted is crucial.

We can either decide to stick to the way Cite works currently, or we can completely overhaul it. If we decide to stick to how it works, then it is desirable to think that because the numbering of <ref> tags depends on their group name, the numbering of the matching <references> should also be governed in the same way. This means we should provide a way in the HTML output of the page to know which <ol> tag belongs to which group of references. See: T196828: The ordered list of refences should indicate the group name

Alternatively, we can decide that the idea of using the "group" parameter to determine the numbering scheme was wrong to begin with, and that we want to overhaul Cite in that regard. Clearly, we cannot do it for the <ref> tags (because that would need several thousands of wikis out there to edit millions of their pages to use a new parameter in the <ref> tags). We can, however, do it for the <references> tag, by defining an optional parameter that explicitly specifies the numbering style for the bibliography. See: T196942: Support for a counter-style parameter in the references tag

I have created patches for both of these proposal, but I have received push-back in both cases. In this task, I expect us to reach an agreement on how to resolve the mismatch in numbering schemes, so that we can move forward with the implementation of the agreed-upon approach. Ideas for a third approach are also very much appreciated.

Event Timeline

Since Ed has provided feedback in both children tasks, respectfully, I am assigning him as the owner of this parent task.

Vvjjkkii renamed this task from Resolve inconsistent numbering of references in text and in bibliography to qeaaaaaaaa.Jul 1 2018, 1:02 AM
Vvjjkkii removed Esanders as the assignee of this task.
Vvjjkkii raised the priority of this task from Medium to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: Aklapper, Huji.
JJMC89 renamed this task from qeaaaaaaaa to qeaaaaaaaaResolve inconsistent numbering of references in text and in bibliography.Jul 1 2018, 4:16 AM
JJMC89 renamed this task from qeaaaaaaaaResolve inconsistent numbering of references in text and in bibliography to Resolve inconsistent numbering of references in text and in bibliography.
JJMC89 assigned this task to Esanders.
JJMC89 lowered the priority of this task from High to Medium.
JJMC89 updated the task description. (Show Details)
JJMC89 added a subscriber: Huji.
Huji raised the priority of this task from Medium to High.EditedJul 13 2018, 12:07 AM

Increasing priority. Would not like to see this become another 10-year-old task.

thiemowmde lowered the priority of this task from High to Low.Jul 13 2018, 7:19 AM
thiemowmde added projects: patch-welcome, Design.
thiemowmde unsubscribed.

Come on. It's not even 3 weeks old.

@thiemowmde what is the threshold number of weeks/months before you would agree this is being neglected?

Most tasks are neglected, because we have too much stuff to do. Trying to “me first” a task will not change that, just annoy people.

@TheDJ equally annoying is for people to -1 patches very quickly (tell one what not to do), but refusing to appear on this Phab task (tell them what to do). But I guess I leave it at that.

Our team only uses "assigned to" for current work.

[…] annoying is for people to -1 patches very quickly […], but refusing to appear on this Phab task […]

I'm afraid crucial information got lost somehow:

  • What patches are you referring to?
  • Which users are refusing what?

@Huji, can you please provide links?

@thiemowmde You could have found the patches by following the links to the two tasks mentioned in the description of this task. But here they are anyway:

This is achieved through the use of group parameter […]

It looks like this feature was added in 2010 via T24265: Allow references to be listed with letters. Notice the discussion that followed after it was implemented. I'm working with <ref>s since they have been introduced, and are very familiar with the syntax and it's limitations. I'm very surprised this misuse of the existing group="…" parameter for styling was accepted.

Adding a new parameter as suggested in T196942 would make this already messy situation worse: The appearances "in text" and "in bibliography" would be controlled by two independent parameters, effectively allowing for even more inconsistencies.

T196828 on the other hand is fine, I believe. It allows to add a bit of CSS on wikis that already have some of these Cite_link_label_group- messages. All this would live in very few pages in the MediaWiki namespace, I hope. Or does it bleed to templates with TemplateStyles?

Like you, @thiemowmde, I am not a big fan of the Cite_link_label_group-* idea to begin with. T196828 was indeed my first proposal to at least make it possible to have the same level of control on the appearance of references "in bibliography" as well.

I don't thin it can/should bleed into templates. The CSS rule should be explicitly defined at the level of the div.mw-references-wrap which is how https://gerrit.wikimedia.org/r/439450/ was designed too