User:Retro/Tooltips

I'm shifting my focus to cleaning up footnote templates before I finish this, since having clear and consistent footnote templates will be a prerequisite for replacing certain tooltips with footnotes.

has been deprecated to discourage invalid use of tooltips.

need to be evaluated and replaced to ensure that tooltips are not being used for non-abbreviation purposes.

The tilde ~ in the table below denotes net differences; more occurrences could have been added in the interrim during deletion, so I don't know the exact number of occurrences that disappeared.

While the number of tooltip occurrences is increasing, that is not necessarily a negative thing (aside from requiring more cleanup); I suspect most of the increases are from copying existing table structures, and I see no reason to discourage that.

Usage sorting
{{cob}}
 * {{sl|hastemplate:"tooltip" insource:/\{\{[Tt]ooltip *\{{!}} *(?:January{{!}}February{{!}}March{{!}}April{{!}}May{{!}}June{{!}}July{{!}}August{{!}}September{{!}}October{{!}}November{{!}}December)[^a-zA-z]/|1286 articles}} misuses the template for dates. These can be replaced by my recently-created {{tlx|dow tooltip}}, but I'd like a template that's a bit more sophisticated; I'm thinking of calling it {{tlx|game date}}. A portion are game reschedulings, which should be handled by table-level footnotes (the format of which I'm still designing). Perhaps these could use a custom rescheduled template that can be tweaked further. {{sl|hastemplate:"tooltip" insource:/\{\{[Tt]ooltip *\{{!}}[^{{!}}]*\{{!}} *Rescheduled/|18 articles}} use tooltips for noting rescheduling, but I think I've seen more using another phrasing.
 * {{sl|hastemplate:"abbr" insource:/\{\{([Tt]ooltip{{!}}[Dd]efine{{!}}[Aa]bbr) \{{!}}[^}]{30,}/|237 articles}} have long tooltips. Most are cricket related, referring to the terms "5WI", "4WI", and "NRR".
 * Sports-related terms could have custom templates to ensure the text is kept consistent for abbreviation tooltips. Like:
 * {{tl|NRR}}: previously deleted, but the previous contents were unrelated.
 * {{tl|4WI}}
 * The trick about standardization is to ensure that it's largely used for that purpose. Otherwise, having a template becomes less useful (though I suppose the anonymous first parameter could allow the context to be specified, like "sport" or "politics", with the most common use prioritized (which will mostly be sports, from what I've seen).) Ultimately, I think standardizing the table headers would be more effective than the tooltips themselves, but I have my qualms about even doing that. Still, there's a bit of precedent for tooltip subtemplates (but that doesn't mean it's a good practice; I've seen some argue that less templates are better, and I agree to a certain extent, but I also think templates with useful functionality still have a place. The question is drawing the line where useful ends and trivial begins. The main argument for tooltip subtemplates is standardization, with only a bit more convenience depending on the name.)
 * {{sl|insource:"tooltip" insource:/\{\{ *[Tt]ooltip/ -hastemplate:tooltip|46 articles}} have {{tlf|tooltip}}, but only in HTML comments.
 * {{sl|hastemplate:Abbr insource:/\{\{ *([Aa]bbr{{!}}[Tt]ooltip) *\{{!}} *[^}{{!}}]*\{{!}}[^}]*?/|45 articles}} have tooltips with {{code|}} or {{code|'''}} formatting in the meaning part of the tooltip. (Imperfect search; it only includes two of the {{tlf|abbr}} redirects; I think one or two others are commonly used.)

Tennis player articles
17$2$ = 289 articles


 * Tennis player:
 * Tennis player statistics:

This methodology still has problems but this could be fixed by downloading a database dump, and there's also the online tools like Toolforge. Here are some potential problems:
 * This excludes tennis player articles that only has one tennis player category where the tennis category is the last category. And yep, {{sl|hastemplate:Tooltip insource:/\{\{ *[Tt]ooltip *\{{!}} *'{0,3}$ ?[0-9,]+/ -insource:"tennis players category" -incategory:"Tennis career statistics"|at least 5 articles}} are missing for this reason.
 * Of course tennis players that don't have categories ending with the word "tennis player" won't be caught by this search, but those would be difficult to find by simple searches without many false postives.
 * My search also caught one odd article out: List of Canada Davis Cup team representatives; apparently it's {{sl|insource:tooltip incategory:"Lists of Davis Cup tennis players"|the only Davis Cup list}} that uses tooltips.

Section titles vary (TODO: systematically enumerate section titles using {{code| ^ *(==+)([^=]+)\1 }}). This is a sample, but it doesn't capture the hierarchies that are present between them: "Grand Slam tournament performance timeline", "Singles", "Doubles", "Grand Slam tournaments", "Grand Slam singles tournament timeline". From my observation of the hierarchies, I gather that "Singles" and "Doubles" are a subset of "Grand Slam tournaments". There's at least one erroneous title that should be updated to be independent of the player's current statistics: "Singles: 7 (5 titles, 2 runner-ups)"

Each of the table cells in {{tlx|performance key}} should probably have a subtemplate; currently formatting consistency is achieved through individual {{para|style}} for each table cell. Maybe something like {{tlx|tennis performance}} or {{tlx|tennis result}} that utilizes the first parameter with the helpful mnemonic. But some of the statuses utilizes no background color, like "Q#", "A", "P", "NMS", "NH".

Here, the term "Strike Rate" is used in a tennis context, while Strike rate only identifies the term in a cricket context, with no see also disambiguation page. (this also capitalizes it title case, but that will probably be corrected to sentence case).

Abbreviations in the "Strike Rate" column are semi-guesses based on {{tlc|Performance key}}.

Tooltips breakdown (severely outdated; only includes 102 articles): {{cob}}
 * Standard abbreviations: {{tlc|tooltip|SR|Strike Rate}} (185), {{tlc|tooltip|W–L|Win–Loss}} (183), {{tlc|tooltip|Ref.|Reference}} (4), {{tlc|tooltip|NH|Not Held}} (4), {{tlc|tooltip|DNQ|Did Not Qualify}} (4), {{tlc|tooltip|SR|Strike rate}} (2), {{tlc|tooltip|W–L|Win–loss}} (2), {{tlc|tooltip|W–L|Win–Loss]}} (2), {{tlc|tooltip|NTI|Not Tier I}} (2), {{tlc|tooltip|WR|winning rate}}
 * Money annotations: {{sl|hastemplate:Tooltip insource:/\{\{ *[Tt]ooltip *\{{!}} *'{0,3}$ ?[0-9,]+/|39 articles}}
 * Person-dependent (1 each): {{tlc|tooltip|DM|Daniil Medvedev}}, {{tlc|tooltip|KK Rank|Karen Khachanov Rank}}, {{tlc|tooltip|ED|Evgeny Donskoy}}, {{tlc|tooltip|AK|Andrey Kuznetsov}}, {{tlc|tooltip|VW Rank|Venus Williams Rank}}, {{tlc|tooltip|LR|Lendl's ATP Ranking}}, {{tlc|tooltip|PKR|Petra Kvitová Rank}}, {{tlc|tooltip|BR|Becker's ATP Ranking}}, {{tlc|tooltip|MR Rank|Milos Raonic}}, {{tlc|tooltip|MR|Mauresmo's WTA Ranking}}, {{tlc|tooltip|NOR|Naomi Osaka Rank}}, {{tlc|tooltip|BAR|Bianca Andreescu Rank}}, {{tlc|tooltip|DKR|Daria Kasatkina Rank}}

Removing from template-space
There are no remaining transclusions of in template-space (for now; it is very possible someone else could derive a table from mainspace to create another template). While the vast majority of impactful replacements were done while I was on my 11 month break from Wikipedia, I carried out ~50 of the edits semi-automatically using my alternate account. I found the transclusions through these two searches (note the second search include parameters named "tooltip"):


 * {{sl|insource:"tooltip" insource:/\{\{ *[Tt]ooltip/ -insource:/[^{]\{\{\{ *[Tt]ooltip/||ns10}}
 * {{sl|insource:"tooltip" insource:/\{\{ *[Tt]ooltip/ -insource:/[^{]\{\{\{ *[Tt]ooltip/||ns10}}

What follows is some organizing of the edits I performed to finish up template-space.

{{cot|title=Organizing template-space replacements}}
 * Straightforward replacements. Most of these are abbreviated column names.
 * Sports tables with similar abbreviated columns names. These might have a potential for some meta-templates: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
 * Conditional infobox parameters (some through edit requests, because they were template-protected): 1, 2, 3, 4, 5
 * Field hockey squad player templates: 1, 2, 3
 * CAF Champions League, "awd." for "Awarded" (though I'm unsure what it means in the context): 1, 2, 3
 * 2018 volleyball team rosters: 1, 2
 * Miscellaneous abbreviations in sports tables: 1, 2, 3
 * Sports team city/state abbreviations: 1
 * (NEWER) FIFA World Cup tables: 1, 2
 * More doubtful:
 * AMD cores. Never heard of "Base" and "Boost", but it's plausible enough: 1, 2
 * Numbers are small and hard to click on: 1
 * I'm unsure what's going on here. I'll have to look at some transclusions to understand how it functions: 1
 * An unnecessary abbreviation of "Apps" for "Appearances" in an infobox, but it's in a sandbox: 1
 * The whole navbox layout with blue text that isn't links seems off to me. There's only one tooltipped item, added in this edit: 1

As noted above regarding the second search, there are a handful of templates that have a parameter named tooltip that don't need edited (because they don't transclude ). Unfortunately I made one mistake here (two, if the sandbox is counted): {{tl|AddNewSection}}, {{tl|Scalable image}}, {{tl|Snooker ranking change}}, {{tl|Tennis points change}}, {{tl|Tennis ranking change}} {{cob}}

Categorization
I'm still populating. There is currently (at least) one erroneous categorization: Dow tooltip, a template I created, is in, but it isn't technically an abbreviation template. I could split into a separate tooltip category, but I'm grouping it with the others currently for convenience because I haven't found many tooltip templates to sort yet.

{{cob}}
 * {{sl|hastemplate:"Abbr" insource:/\{\{[Aa]bbr/ -hastemplate:Navbox -hastemplate:Infobox -insource:"wikitable" -deepcat:"Abbreviation templates"||ns10}}
 * Old search. Replaced because I was concerned about false negatives.
 * {{sl|insource:"abbr" insource:/(\{\{{{!}}\<)abbr/ -insource:"sidebar" -insource:"Navbox" -insource:"Infobox" -insource:"wikitable" -deepcat:"Abbreviation templates"||ns10}}
 * 491
 * {{sl|insource:"abbr" insource:/([^{]\{\{{{!}}\<)abbr/ -insource:"sidebar" -insource:"Navbox" -insource:"Infobox" -insource:"wikitable" -deepcat:"Abbreviation templates"||ns10}}
 * 435
 * {{sl|insource:"abbr" insource:/([^{]\{\{{{!}}\<)abbr/ -insource:"sidebar" -insource:"Navbox" -insource:"Infobox" -insource:"wikitable" -insource:"Sports table" -deepcat:"Abbreviation templates"||ns10}}
 * 205
 * {{sl|insource:"abbr" insource:/([^{]\{\{{{!}}\<)abbr/ -insource:"sidebar" -insource:"Navbox" -insource:"Infobox" -insource:"wikitable" -insource:"Sports table" -insource:"toccolours" -deepcat:"Abbreviation templates"||ns10}}
 * 195 ; see also {{sl|insource:"toccolours" -insource:"class toccolours"||ns10}}
 * {{sl|insource:"abbr" insource:/([^{]\{\{{{!}}\<)abbr/ -insource:"sidebar" -insource:"Navbox" -insource:"Infobox" -insource:"wikitable" -insource:"Sports table" -insource:"toccolours" -insource:"Routemap" -deepcat:"Abbreviation templates"||ns10}}
 * 167; should perhaps use {{code|hastemplate:"Routemap"}} instead of {{code|insource:"Routemap"}}
 * {{sl|insource:"abbr" insource:/([^{]\{\{{{!}}\<)abbr/ -insource:"sidebar" -insource:"Navbox" -insource:"Infobox" -insource:"wikitable" -insource:"Sports table" -insource:"toccolours" -insource:"Routemap" -intitle:"sandbox" -deepcat:"Abbreviation templates"||ns10}}
 * 136
 * {{sl|insource:"abbr" insource:/([^{]\{\{{{!}}\<)abbr/ -insource:"sidebar" -insource:"Navbox" -insource:"Infobox" -insource:"wikitable" -insource:"Sports table" -insource:"Routemap" -intitle:"sandbox" -deepcat:"Abbreviation templates"||ns10}}
 * 142
 * {{sl|insource:"abbr" insource:/([^{]\{\{{{!}}\<)abbr/ -insource:"sidebar" -insource:"Navbox" -insource:"Infobox" -insource:"wikitable" -insource:"Sports table" -insource:"Routemap" -intitle:"sandbox" -intitle:"Did you" -deepcat:"Abbreviation templates"||ns10}}
 * 129; see also {{sl|intitle:"Did you" -intitle:"Did you know"||ns10}}