Look through the dominant {{reflist}} templates (name may vary) and reverse-engineer all functionality from the template documentation, template source, and any transcluded stylesheets.
* Wikis to study: enwiki, TBD (biggest, RTL, representative sample)...
* Global search query to find reflist template: TBD (copy snippet from other tasks)
Functionality which is passed through the template to <references> will be omitted here when we already have parity. Examples:
* `refs` for list-defined references
* `group`. Note that some templates decouple predefined list marker styles from the "group".
* `responsive`. But note that almost all multicolumn implementations in reflist templates are now a facade in front of Cite `responsive="1"`, plus minor CSS styling.
* Stylesheets like on [[ https://en.wikipedia.org/wiki/Template:Reflist/styles.css | enwiki ]] are equivalent to global style overrides and were only attached to the template for encapsulation.
* Parameter validation.
Multicolumn is not omitted from the survey, but note that the Cite `responsive` feature already provides parity.
* Migration was started in 2015, see {T33597}.
* Note that the configuration variable `$wgCiteResponsiveReferences` sets the default value, it's not a feature flag. The feature is available on all sites.
* This could be ported to community configuration, which might also encourage more sites to enable it as default.
* Interesting that the default threshold of 10 is never overridden.
== Wikis reviewed ==
* enwiki
* [[ https://en.wikipedia.org/wiki/Template:Reflist | {{reflist}} ]]
* multicolumn
* TBD: columns are broken in template docs?
* predefined templates like [[ https://en.wikipedia.org/wiki/Template:Notelist | {{notelist}} ]] come with a default group name, which set the alphabet for its footnotes and are each paired with a specific {{efn}} variant.
* Possible misfeature: can override the footnote markers separately in reflist vs. article. "This should be used with care as it can be confusing to readers."
* Can ignore the unbalanced [[ https://en.wikipedia.org/wiki/Template:Refbegin | {{refbegin}} ]] and [[ https://en.wikipedia.org/wiki/Template:Refend | {{refend}} ]] wrap bibliographic-style citations, but never a reflist.
* frwiki
* [[ https://fr.wikipedia.org/wiki/Mod%C3%A8le:R%C3%A9f%C3%A9rences | {{références}} ]]
* multicolumn
* Automatically change number of columns depending on namespace.
* Some templates add a tracking category when number of columns > 2
* Adds an element for CSS, `div.reference-cadre`
* TBD: what is `tabindex="0"` doing, it seems like a no-op?
* [[ https://fr.wikipedia.org/wiki/Mod%C3%A8le:R%C3%A9f%C3%A9rences_nombreuses | {{références nombreuses}} ]] collapses using a scrolling frame. This is pure CSS, using `height` and `overflow: auto`.
* eswiki
* [[ https://es.wikipedia.org/wiki/Plantilla:Listaref | {{listaref}} ]]
* multicolumn
* set symbols separately from group name
* arwiki
* Sometimes an explicit reflist div is included in wikitext, eg in [[ https://ar.wikipedia.org/w/index.php?title=%D8%B3%D9%88%D8%B1%D8%A9_%D8%A7%D9%84%D8%B4%D9%85%D8%B3&action=edit§ion=19&editintro=%D9%82%D8%A7%D9%84%D8%A8:%D8%AA%D8%A8%D8%B5%D8%B1%D8%A9_%D9%85%D8%AD%D8%AA%D9%88%D9%89_%D9%85%D8%AA%D9%85%D9%8A%D8%B2 | this section ]].
* Uses unbalanced templates like [[ https://ar.wikipedia.org/w/index.php?title=%D9%82%D8%A7%D9%84%D8%A8:%D8%A8%D8%AF%D8%A7%D9%8A%D8%A9_%D8%A7%D9%84%D9%85%D8%B1%D8%A7%D8%AC%D8%B9&action=edit | {{بداية المراجع}} ]] to open a div tag.
* Often doesn't use <references> at all!
* Multicolumn
* Hanging indent styling.
* Collapse to a scrolling box (pure CSS).
* [[ https://ar.wikipedia.org/w/index.php?title=%D9%82%D8%A7%D9%84%D8%A8:%D9%85%D8%B1%D8%A7%D8%AC%D8%B9&action=edit | {{مراجع}} ]]
* Optionally switch containing element to `dir=ltr`
* Set symbol separate from group name
* fawiki
* [[ https://fa.wikipedia.org/wiki/%D8%A7%D9%84%DA%AF%D9%88:%D9%BE%D8%A7%D9%86%D9%88%DB%8C%D8%B3 | {{پانویس}} ]]
* multicolumn
* set symbol separately from group name
* hewiki
* [[ https://he.wikipedia.org/wiki/%D7%AA%D7%91%D7%A0%D7%99%D7%AA:%D7%94%D7%A2%D7%A8%D7%95%D7%AA_%D7%A9%D7%95%D7%9C%D7%99%D7%99%D7%9D | {{הערות שוליים}} ]]
* Container optionally rtl or ltr
* multicolumn
* svwiki
* Decided not to use the template in 2007. See [[ https://sv.wikipedia.org/wiki/Malldiskussion:Reflist | discussion ]].
* nlwiki
* [[ https://nl.wikipedia.org/w/index.php?title=Sjabloon:References | {{references}} ]]
* multicolumn
* Translates the standard group names
* [[ https://nl.wikipedia.org/w/index.php?title=Sjabloon:Appendix | {{appendix}} ]]
* Standardized section names
* [[ https://nl.wikipedia.org/w/index.php?title=Sjabloon:References-scroll | {{references-scroll}} ]]
* Collapse to a scrolling box
* ruwiki
* [[ https://ru.wikipedia.org/wiki/%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%87%D0%B0%D0%BD%D0%B8%D1%8F | {{Примечания}} ]]
* multicolumn
* set symbol separately from group name
* itwiki
* Decided not to use the template in 2017. See [[ https://it.wikipedia.org/wiki/Discussioni_template:References#Note_in_colonne | discussion ]].
* plwiki
* [[ https://pl.wikipedia.org/wiki/Szablon:Przypisy | {{przypisy}} ]] which calls Lua [[ https://pl.wikipedia.org/wiki/Modu%C5%82:Przypisy | Module:Przypisy ]]
* multicolumn (always)
* (Seems that the Lua module is only doing parameter validation.)
== Summary of features ==
* All existing functionality plus arbitrary future-compatibility could be provided simply by passing through CSS `class` and `style` parameter values. With class and style attributes, users are free to experiment or to rely on site-wide and global extension-bundled shared styles.All existing functionality we've found in the wikis above can be reduced to these categories:
* Precedent: wiki tables* CSS tweak. style and class attributes can be used in tables and table rows ([[ https://en.wikipedia.org/wiki/Help:Basic_table_markup#Common_attributes | docs ]]). Inline styles can be used on div and span. The attributes are passed through using PHP `Sanitizer::fixTagAttributes`These may be applied globally to all reference lists, selected by choice of template, or configured by template parameter.
* Translation. * Precedent: vuejWikitext tag names are not currently localized, but template and parameter names can be.
Less commonly, the template extends beyond the reference list to its container: setting the section title and style, and suppressing the edit links. This is aligned with standard HTML and with modern component frameworks (eg. [[ https://vuejs.org/guide/essentials/class-and-style.html | vuejs ]]).will be left out of scope for now.
A full list of features, [TBD: and links to follow-up investigation]
* Set footnote symbol alphabet separately from group name* Multicolumn. Already have sufficient support in Cite `responsive`.
* We should require that inline footnote markers use the same symbols as the reflist* RTL / LTR. This avoids theMore investigation need to provide customizability on the ref tag. TBD: but look at cases where the symbols divergeed, it's possible that Cite `dir` is already sufficient.
* C* Predefined configuration to set the default symbols for all groupss using a short name, eg. "{{references-scroll}}".
* Part of this need may be to have the symbol* Translated names translated into the content languages, eg. "{{références}}".
* Footnote mark symbol, eg. "β". * It would be problematic to allow multiple groups to use the same symbolsThis is already implemented, but needs redesign to rationalize and consolidate.
* Maybe part of this need is to suppress group names?* Collapsed list, scrolling in a fixed-height frame.
* Collapsing to a fixed height and adding a scroll bar. This is done using pure CSS `height` and `overflow`.* Miscellaneous styling maybe not shared across many wikis.
== Suggested reimplementations ==
=== Free styling ===
* Cleaning up the RTL / LTR container behaviorPass through the `class` and `style` parameters. This is already an [[ https://en.wikipedia.org/wiki/Help:Basic_table_markup#Common_attributes | accepted pattern ]] in wikitext, and a standard building block in HTML and component frameworks (eg [[ https://vuejs.org/guide/essentials/class-and-style.html | vuejs ]]).
A suite of standardized reflist style tweaks can be bundled with Cite, for example "collapsed", "two-column", "greek". We have a `dir` attribute alreadyThese can be applied one at a time or in combination.
Visual editor could expose these as checkboxes each toggling a class name, and a free text "class" attribute for additional user- or site-provided styles.
Community configuration could also expose these styles as checkboxes, perhaps this is buggy?but as a default to apply to all reflists. Unclear what the needs are,"no-" reverse styles should be provided to counteract these, eg. without more investigation."no-collapsed".
Sites can override the bundled styles by adding more CSS rules for the class.
Free styling can be used to support the following features
* Standardized section names. This might be seen as inconsistent with the manual sections elsewhere in the articles, however..* Multicolumn fine-tuning.
* Suppress section edit linksCollapse to a scrolling box, with `height` and `overflow`.
* Arbitrary one-off, site-customized, styles.
* Forwards compatibility. Any template that passes through style and class attributes can be used in combination with existing or future styles. (To compare with a feature not compatible with generic styling: the `responsive` attribute requires explicit wiring between the template's multicolumn parameter and the responsive parameter.)
Tech breadcrumb: attributes can be wired in PHP using `Sanitizer::fixTagAttributes`, which converts an arbitrary string of user-provided attributes into a sanitized subset safe to reapply to the output.
=== Right-to-left ===
TBD: Work should continue independently, probably by improving the existing `dir` attribute.
=== Translation ===
Visual editor already works around this entire problem by hiding literal tag names from the user.
The translation problem is the same for all wikitext tags, and underlies much gratuitous template usage. TBD: link to proposals to make tags translatable.
=== Predefined names—and the inevitability of templates ===
It seems likely that communities will still want to hold on to their templates, because of translation and to use predefined names for a set of styles, eg. "footnotes". Here I'll propose a minor tweak to TempateData which could help in that scenario:
Several new TemplateData parameter data types might come to the rescue here:
* "ref list" - Giving a parameter this type gives the visual editor a hint that it holds a collection <ref> tags which could be inspected and manipulated.
* "class" - ChipInput for boolean class names. If we find a reference list when introspecting the template output, we could even provide the reflist class presets...
* "style" - inline CSS, with validation that you're not using illegal rules or bad syntax.
=== Footnote symbols ===
The group name, choice of symbol alphabet, and whether or not to show the group name should be split into separate features. We've heard anecdotes about thisBut they are intertwined so first we should better understand user needs.
There are divergent implementations of footnote symbols which need to be merged, in conjunction with {T370027}:
* Literal symbol dynamically produced by Cite, for example "1", "2".
* MediaWiki messages with the entire sequence of symbols, for example [[ https://fa.wikipedia.org/wiki/%D9%85%D8%AF%DB%8C%D8%A7%D9%88%DB%8C%DA%A9%DB%8C:Cite_link_label_group-lower-alpha | lower-alpha ]].
* CSS list-style and counter-reset.
Community configuration should be provided to set the default and other predefined symbol sequences.
Visual editor could allow symbol customization for each reference list.
== Suggested migration ==
Existing templates could be simplified incrementally, by pushing customizations into CSS and applying to all reflists or depending on a class name.
The shared, generalized styles should be provided through the Cite extension, and it might explain some of the <div> containers which appearbefore we ask communities to adapt. Possibly a better solution would be to show more guidance in the editor interface when the section contains a reflistIdeally, the bundled styles can be used as-is, or if they are customized then this is done on top of a small set of known classes which simplifies future migrations.
== Follow up ==
Would a scraper run be helpful for analyzing what wikitext is actually produced by the reflist templates, and even counting usages of specific features?~~If necessary we can run the scraper to analyze usage frequency of specific features.~~
Follow up by roughly estimating the effort to reimplement each behavior in Cite for the <references> tag.