Wikipedia:Bots/Requests for approval/SdkbBot 4
New to bots on Wikipedia? Read these primers!
- Approval process – How this discussion works
- Overview/Policy – What bots are/What they can (or can't) do
- Dictionary – Explains bot-related jargon
Operator: Sdkb (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 05:08, Wednesday, August 2, 2023 (UTC)
Function overview: Replaces {{Collapsible option}} with {{Navbox documentation}} (a wrapper of {{Collapsible option}} that also includes TemplateData and other basic documentation elements) for navigation boxes that have no documentation except beyond {{Collapsible option}}.
Automatic, Supervised, or Manual: Automatic
Programming language(s): AutoWikiBrowser
Source code available: The bot will be operated by running through the list of template-space pages from the RegEx search query hastemplate:"collapsible option" -hastemplate:"documentation" insource:/\<noinclude\>.\{\{collapsible option}}.\[\[Category:.*navigational boxes\]\].*\<\/noinclude\>/
with a find and replace for {{collapsible option}}
→{{navbox documentation}}
. It will use the edit summary Switch to more comprehensive documentation
.
Links to relevant discussions (where appropriate): I don't know of anyone who prefers less complete documentation, so I anticipate this will be an uncontroversial task. I'll drop notices of this BRFA at WT:Template documentation, WT:Navigation template, Help talk:Collapsing, Template talk:Navbox documentation, and Template talk:Collapsible option to ensure visibility.
Edit period(s): One-time run
Estimated number of pages affected: 39,000
Namespace(s): Template
Exclusion compliant (Yes/No): Yes
Function details: Many navboxes have only {{Collapsible option}} (which I recently redesigned) as a kind of quasi-documentation. {{Navbox documentation}}, created by MJL in 2019, is a wrapper of {{Collapsible option}} that also includes other helpful elements, such as the standard green documentation background, information on correct placement, and TemplateData (which I added the other day, making it easier to add/configure navboxes with VisualEditor). These elements make it a direct improvement over {{Collapsible option}} alone. However, it has very limited usage: less than 250 transclusions, compared to 134,000 for {{Collapsible option}}. This task aims to convert a portion of those transclusions to the wrapper, specifically those that are easily identified as having no other documentation present. I may modify the search query over time to help find additional instances beyond the 25,00039,000 identified so far.
Discussion
Kudos to Certes for helping me figure out the search query. I conducted a test with my non-bot account of a little over a hundred instances earlier and ran into no issues. {{u|Sdkb}} talk 05:08, 2 August 2023 (UTC)
- So this is potentially a dumb question, but if all you are doing is making a wrapper for collapsible option that does little more than put a green box around it and (for some reason) add TemplateData, why not just do that to {{collapsible option}} itself and save the hassle of having to replace 25k templates? (please do not ping on reply) Primefac (talk) 08:02, 2 August 2023 (UTC)
- Not a stupid question! Since {{Collapsible option}} is just a chunk of text, it's designed to go within a larger documentation, and is used that way in some other instances (as many as 15,000). Converting it directly would break those. {{u|Sdkb}} talk 13:31, 2 August 2023 (UTC)
- I'm not sure I understood your response, but am I correct that you want it to do one thing when it's transcluded on its own, and another thing when it's transcluded in another template? If so, you may not need a bot for that, just an adjustment of the templates using Inclusion control or selective transclusion. I did this at French Wikipedia for their Régime de Vichy nav bar template (analogous to our {{Vichy regime}} navbar). The template uses a subtemplate, /Participants, which is also a nav template in its own right which may be used on its own (that is, transcluded directly in the footer of an article as a nav bar), or may be transcluded in the main template, and appears differently in each case. Is this something like what you need to do? Mathglot (talk) 17:40, 2 August 2023 (UTC)
- Rereading, I'm starting to get a better view, and could you not just further modify {{collapsible option}} so it does what {{navbox documentation}} does now, in those cases where you want it to do so? Still not sure I'm getting it. Maybe I should be asking a negative: in what cases do you not want to apply the bot? Is it just that the name of the new template is more transparent, so we could make it a wrapper the other way around with a new param in the newer one? Mathglot (talk) 18:12, 2 August 2023 (UTC)
- Not a stupid question! Since {{Collapsible option}} is just a chunk of text, it's designed to go within a larger documentation, and is used that way in some other instances (as many as 15,000). Converting it directly would break those. {{u|Sdkb}} talk 13:31, 2 August 2023 (UTC)
Updated the query, which brings the number of affected pages up to 39,000. {{u|Sdkb}} talk 15:41, 2 August 2023 (UTC)