Wikipedia:Bots/Requests for approval/SdkbBot 4
- The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at Wikipedia:Bots/Noticeboard. The result of the discussion was Approved.
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
[edit]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)[reply]
- 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)[reply]
- 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)[reply]
- 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)[reply]
- 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 {{collapsible option}} a wrapper the other way around with a new param in the newer one, i.e., code of collapsible option gets moved into the newer one under conditional control of
|collapsible=yes
, which would be set in {{collapsible option}} when it transcludes the other one? Mathglot (talk) 18:18, 2 August 2023 (UTC)[reply]- @Mathglot, sorry for the confusion. Some examples might help. Here's a template that uses Collapsible option in a standalone way as a kind of proto-documentation; this is what I would be looking to convert to Navbox documentation, to make it look like this. This, on the other hand, is an example of template that uses Collapsible option as an element within a larger existing documentation. We don't want to change anything there (lest we end up with documentation-within-documentation).
- I suppose it might theoretically be possible to change Collapsible option so that it tries to detect whether or not it's embedded within larger documentation, and only generates the green box etc. if it's standing alone (is that what you're suggesting?). I don't think that would be a wise approach, though. It would introduce a lot of complexity to Collapsible option. Generally speaking, we don't want a template that's trying to be both an element within documentation or a full documentation depending on the circumstances, unless we have no other option. Right now, Collapsible option is the element and Navbox documentation is the full doc, and keeping them both to maintain that distinction makes sense. This approach would also require us to worry about detection errors (e.g. navboxes that have additional documentation but lack the {{documentation}} template; this is plausible given that Collapsible option is an old template slightly predating {{documentation}} and that many navboxes are low-visibility templates that haven't been well-maintained). A one-time bot run would be a lot more edits, but I think it'd put us in a much cleaner situation at the end of it, which is what we want for the long term.
- Does that help clarify? Cheers, {{u|Sdkb}} talk 19:41, 2 August 2023 (UTC)[reply]
- Yes, thanks. More edits now vs. cleaner later is probably a good tradeoff. Mathglot (talk) 20:18, 2 August 2023 (UTC)[reply]
- 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)[reply]
Updated the query, which brings the number of affected pages up to 39,000. {{u|Sdkb}} talk 15:41, 2 August 2023 (UTC)[reply]
- Approved for trial (50 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Please do not mark these as minor so that there is a higher chance of feedback, especially since there has been little in the way of prior discussion over this matter. Primefac (talk) 16:06, 6 August 2023 (UTC)[reply]
- Trial complete. See diff of edits. Cheers, {{u|Sdkb}} talk 06:33, 7 August 2023 (UTC)[reply]
- {{BAG assistance needed}} Bumping, given no comments for three weeks. The trial appears to have gone smoothly, so I'm ready to move forward once approval is granted. Cheers, {{u|Sdkb}} talk 16:52, 28 August 2023 (UTC)[reply]
- Looks good. Much better documentation. SWinxy (talk) 17:53, 28 August 2023 (UTC)[reply]
- Approved. Primefac (talk) 08:52, 30 August 2023 (UTC)[reply]
- Trial complete. See diff of edits. Cheers, {{u|Sdkb}} talk 06:33, 7 August 2023 (UTC)[reply]
- The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at Wikipedia:Bots/Noticeboard.