Page MenuHomePhabricator

Document Parsoid replacement for MediaWiki:cite_link_label-* customization
Closed, ResolvedPublic

Description

Parsoid doesn't support editing citation link labels by editing the special [[MediaWiki:cite_link_label_group-XX]] page, usually used to localize the name of a particular citation group.

With the HTML/CSS used by Parsoid, this would be done with sitewide CSS instead of by editing article pages. I believe that the same groups of users with the permission to edit in the MediaWiki namespace would have permissions to edit [[MediaWiki:Common.css]], so this should be an equivalent feature (ie, not require dev access to gerrit in order to localize citation group names).

Waving hands vaguely, if you previously had [[MediaWiki:cite_link_label_group-klingon]] with the contents:

wa'  cha' wej loS vagh jav Soch chorgh Hut wa'maH

Then for equivalent behavior in Parsoid you'd need to add the following to [[MediaWiki:Common.css]]:

@counter-style klingon-counter {
  system: fixed;
  symbols: "wa'" "cha'" "wej" "loS" "vagh" "jav" "Soch" "chorgh" "Hut" "wa'maH";
}

[rel="dc:references"] > [data-mw-group="klingon"] {
       counter-reset: klingon-ref 0;
 }
[rel="dc:references"]> [data-mw-group="klingon"]::before {
       content: counter(klingon-ref, klingon-counter);
 }
[rel="dc:references"] > [data-mw-group="klingon"] > span.mw-reflink-text {
      display: none;
}

FIXME: the above is untested!

(Worth remembering that data-mw-group can't be stripped from read view HTML though without breaking this.)

This phab task is for documenting this transition appropriately on wiki, in tech news, etc. If editors demand, we might need to coordinate migration of MediaWiki:cite_link_label-* articles to appropriate CSS.

@ssastry suggests: "see 2nd column of https://phabricator.wikimedia.org/project/view/5534/ and https://github.com/wikimedia/integration-visualdiff/blob/e51e7f0ecb26bd970fced6c7494125426169476d/lib/parsoid.custom_styles.yaml for various CSS to be added to wiki CSS pages."

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Arlolra triaged this task as Medium priority.Jun 2 2022, 6:09 PM
Arlolra moved this task from Needs Triage to Missing Functionality on the Parsoid board.

I believe that the same groups of users with the permission to edit in the MediaWiki namespace would have permissions to edit [[MediaWiki:Common.css]]

Only interface admins have access to the entire namespace, which even on English WP with its approximately ~1000 adminis is a set of some 15 editors. Administrators without interface admin rights do not have access to Common.css but can create these group pages. This is a minor point but puts more burden on small wiki support to set up 'groups'.

It might be wiser to set up some MediaWiki:Cite.css which is loaded only on the pages where Extension:Cite executes, if this is a way you want to go.

Common.css really shouldn't be the first customization point looked-to regardless if possibly avoidable, if I had a choice.

Change 849738 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/services/parsoid@master] [Read Views Migration Tooling]: Programmatically generate cite CSS

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

https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Cite_CSS is now more or less done and I am going to mark this resolved. I'll continue to tweak the scripts and page this week and in a week or two, we will probably start outreach on wikis to get the Mediawiki:Commons.css updated on wikis.

Change 849738 merged by jenkins-bot:

[mediawiki/services/parsoid@master] [Read Views Migration Tooling]: Scripts to generate cite CSS

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

Change 885031 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.17.0-a13

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

Change 885031 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.17.0-a13

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