⚓ T196828 The ordered list of refences should indicate the group name
Page MenuHomePhabricator

The ordered list of refences should indicate the group name
Open, MediumPublic

Description

A tag like <references group=foo/> will output an ordered list in HTML but this output does not contain any indication of the group name foo in it.

Adding it as an attribute such as <ol data-group="foo" ... would be great, because sometimes it is desirable to apply certain CSS (such as certain @counter-style) to all ref lists that share their group name.

Note that a group name may contain spaces or other special characters (but not quotes) so it cannot be simply added as <ol class="references-foo" ...

Event Timeline

Huji triaged this task as Medium priority.Jun 10 2018, 12:01 AM

Change 439450 had a related patch set uploaded (by Huji; owner: Huji):
[mediawiki/extensions/Cite@master] The ordered list of refences should indicate the group name

https://gerrit.wikimedia.org/r/439450

I think it would be better to allow users to choose the counter style they wanted, rather than setting an undocumented and localised name.

Note also that Parsoid output already adds data-mw-group to the list and listitems.

@Esanders take https://en.wikipedia.org/wiki/User:Huji/citegroup as an example, there is no indication either in the OL or the LI that the citation lists is for a specific group.

I think it would be better to allow users to choose the counter style they wanted, rather than setting an undocumented and localised name.

Yes, but how does that conflict this patch? If anything, this patch makes it easier for users to apply a counter style to all citations that belong to the same group. This patch does not implement any particular counter style, does it?

This patch does not implement any particular counter style, does it?

That's the problem, it defines no standard for how to apply a particular counter style, which means we will end up with a different (undocumented) standard on every wiki.

I'm not sure if I follow.

Perhaps if I explain the exact use case I have in mind, that would clear things up. The fawiki version of the templates {{efn}} and {{notelist}} create <ref> tags and <references> tags with the default group "persian-alpha". The idea is that the refs will be numbered using persian alphabet (so instead of 1, 2, 3... they would be الف, ب, پ, ...). For the <ref> tags, this is easily done by customizing MediaWiki:Cite_link_label_group-persian-alpha. For the <references> tag though, because it is not possible to know which <OL> belongs to what group, you cannot apply a CSS that would endorse a particular counter-style just for the right <OL> tag(s).

Had the output of <references group="persian-alpha"> been something like <ol data-group="persian-alpha"> then we could have easily configured it to use the desired counter style by first defining it in MediaWiki:Common.css (which we already have) and then including a rule like OL[data-group="persian-alpha"] { list-style-type: persian-alpha; }

So you see, the whole idea here is to just make it possible for each wiki to implement CSS that would apply to the output of all <references> tags that have the same group name, should they desire to do so. And obviously, not every wiki wants to customize the {{efn}} and {{notelist}} templates that way (e.g. in enwiki, the default counter is "lower-alpha", and they don't have to apply any CSS because a lower-alpha counter is already part of CSS3).

Had the output of <references group="persian-alpha"> been something like <ol data-group="persian-alpha"> then we could have easily configured it to use the desired counter style by first defining it in MediaWiki:Common.css (which we already have) and then including a rule like OL[data-group="persian-alpha"] { list-style-type: persian-alpha; }

My point is that this is the incorrect way to approach things. You now have a rule on fa.wiki that maps the group name "persian-alpha" to a specific CSS rule. However that rule is not part of MW software, but a local wiki hack which is harder to document, harder to keep consistent, and also needs to be duplicated across thousands of wikis.

No imagine you are building an editing tool that lets you change the list style of a reference list. There is no way to know what options to present to the user, as it varies from wiki to wiki.

A better solution would just be to add an attribute for the behaviour you want with documented values, e.g. <references list-style="persian-alpha">.

In this particular scenario, what you suggest works as well. I created a separate task for that.

That said, why do you think it is a bad idea in general for us to know which OL belongs to which reference group? Parsoid already does that for LI elements; if it is okay there, why is it not okay here?

PS: You said:

No imagine you are building an editing tool that lets you change the list style of a reference list. There is no way to know what options to present to the user, as it varies from wiki to wiki.

Well, this already is the case! Cite uses system messages like MediaWiki:Cite link label group-lower-alpha etc which may or may not be available in a particular project.

Vvjjkkii renamed this task from The ordered list of refences should indicate the group name to vbbaaaaaaa.Jul 1 2018, 1:04 AM
Vvjjkkii removed Huji 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: gerritbot, Huji, Aklapper.
CommunityTechBot renamed this task from vbbaaaaaaa to The ordered list of refences should indicate the group name.Jul 2 2018, 12:49 PM
CommunityTechBot assigned this task to Huji.
CommunityTechBot lowered the priority of this task from High to Medium.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Huji, Aklapper.

Removing task assignee due to inactivity, as this open task has been assigned to the same person for more than two years (see the emails sent to the task assignee on Oct27 and Nov23). Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome.
(See https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator.)

Change 991614 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Jon Harald Søby):

[mediawiki/extensions/Cite@master] Add group name in data attribute to <references>'s html output

https://gerrit.wikimedia.org/r/991614

Change 439450 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/Cite@master] The ordered list of references should indicate the group name

Reason:

Mostly obsolete via I91eb3ae. Let's focus on that one.

https://gerrit.wikimedia.org/r/439450

Change 998778 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] [POC] Call Parser::recursiveTagParse as early as possible

https://gerrit.wikimedia.org/r/998778

Change 1000931 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] Do not parse the outer <ol> as wikitext

https://gerrit.wikimedia.org/r/1000931

Change #1000931 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Do not parse the outer <ol> as wikitext

https://gerrit.wikimedia.org/r/1000931