Wikisource:Bot requests/Archives/2025
Appearance
Latest comment: 1 month ago by CalendulaAsteraceae in topic Replace some uses of Template:S with Template:Long s
![]() | Please do not post any new comments on this page.
This is a discussion archive first created in , although the comments contained were likely posted before and after this date. See current discussion or the archives index. |
Migrate more one- and two-parameter invocations of Template:RunningHeader
- This section was archived on a request by: This got complicated! Better to start over if I have follow-up requests. —CalendulaAsteraceae (talk • contribs) 01:36, 14 January 2025 (UTC)
Replacements:
{{[running header]|[text]}}
to{{rh|[text]||}}
{{[running header]||[text]}}
to{{rh||[text]|}}
{{[running header]|[text]|}}
to{{[running header|[text]||}}
{{[running header]|[left text]|[center text]}}
to{{rh|[left text]|[center text]|}}
{{[running header]|[left text]|[center text]|{{[template]|[space or nothing]}}}}
to{{rh|[left text]|[center text]|}}
{{[running header]|{{[template]|[space or nothing]}}|[center text]|[right text]}}
to{{rh||[center text]|[right text]}}
{{[running header]|{{[template]|[space or nothing]}}|[text]|{{[template]|[space or nothing]}}}}
to{{rh||[text]|}}
- delete
{{rh|| }}
—CalendulaAsteraceae (talk • contribs) 03:38, 21 November 2023 (UTC)
- Just to note... Since there's no pre-made page generator to give pywikibot all these pages to work on I am going to have to make custom bot to loop over them, and since I don't have any similar code lying around that's going to have to wait until I have the time to sit down to figure out how to do that. Pywikibot also at some point seems to have dropped the ReplaceBot class, so I may have to reimplement a lot of the basic logic for that too. @Mpaa: you wouldn't happen to have any code like this handy that you could share? Or any advice on how to approach this? Xover (talk) 07:02, 26 November 2023 (UTC)
- @Xover it's called ReplaceRobot it this what you mean. I would use replace.py and make it in chunks; note that you can feed several -prefixindex:<prefix> at at time.
- As a side comment, it seems you are changing the signature for {{rh}}, isn't it? If so, I haven't followed the discussion and the rational, but given the wide and long established use of the template, I am a bit skeptical (e.g. I have never specified the last | in {{rh|10|SOME WORK}}, so I expect a learning time, with more of this kind of replacement to be done. Mpaa (talk) 11:52, 26 November 2023 (UTC)
- @Mpaa: Isn't that an internal class for the replace.py script? There used to be a base pywikibot
ReplaceBot
class for making custom replace bots, but it got dropped at some point (or at least I wasn't able to find it). My Python-fu is pretty weak sauce so I could just be confused.I've been using stock replace.py with options, but the list of indexes above is going to be a bear to do that way so I was looking for some way to do it in a foreach (and wrapping replace.py in perl, natch, failed due to PAWS' funky handling of stdin).And, yes, the bot runs are part of changing the call signature of {{rh}} such that the number of args determines how many cells you get. The change should (I think) be immediately obvious so the learning curve might not be so bad. The most tricky case is when rh only gets two params, because that used to give you left+center and will now give you left+right. Xover (talk) 18:46, 26 November 2023 (UTC)
- @Mpaa: Isn't that an internal class for the replace.py script? There used to be a base pywikibot
- @Xover: Would it be easier for you to work with a tracking category? If so, we should talk in more detail about the tracking categories I've added to Module:Running header and my thoughts on a two-stage migration. —CalendulaAsteraceae (talk • contribs) 01:06, 27 November 2023 (UTC)
- @CalendulaAsteraceae: Yes. Any list of pages I can reliably get from one of the Page Generators is much easier to work with because then I can just fire off the stock replace.py script. Getting the regexen right still requires some tweaking, but I speak regex natively so that's usually not a big problem.Making a custom script for stuff like this isn't really that hard either, it's just that I have never done it—or worked with other custom pywikibot code—and combined with not being a Python coder it means it takes sustained attention and effort to learn first (which is the kind of time I have trouble finding).Incidentally, Mpaa, being able to specify an Index: page in order to work on all the Page:es associated with it, might be a nice convenience for pywikibot.
-pagesinindex:"Foo.djvu"
or something.-prefixindex:"Page:Foo.djvu/"
with manual fiddling works fine, but it is a couple of extra steps. Xover (talk) 07:06, 28 November 2023 (UTC)
- @CalendulaAsteraceae: Yes. Any list of pages I can reliably get from one of the Page Generators is much easier to work with because then I can just fire off the stock replace.py script. Getting the regexen right still requires some tweaking, but I speak regex natively so that's usually not a big problem.Making a custom script for stuff like this isn't really that hard either, it's just that I have never done it—or worked with other custom pywikibot code—and combined with not being a Python coder it means it takes sustained attention and effort to learn first (which is the kind of time I have trouble finding).Incidentally, Mpaa, being able to specify an Index: page in order to work on all the Page:es associated with it, might be a nice convenience for pywikibot.
- @Xover it's called ReplaceRobot it this what you mean. I would use replace.py and make it in chunks; note that you can feed several -prefixindex:<prefix> at at time.
- @CalendulaAsteraceae: How did you come up with this list of indexes? Is it something we can automate adding a tracking category to? Or maybe just list all the pages somewhere? It's going to take a while for me to get around to figuring out how to do a custom PWB bot for this, and I have several higher-priority projects. If we can find some way to make the page selection in a way the pywikibot's standard generators can consume it'd be much easier (read: faster). Xover (talk) 09:05, 30 January 2024 (UTC)
- @Xover: I came up with this list of indexes by doing a regex insource search and checking the results manually, but if we switch to using Module:Running header (in its current form, which doesn't change functionality) it will add tracking categories automatically. —CalendulaAsteraceae (talk • contribs) 15:18, 30 January 2024 (UTC)
- @Xover: The category's still filling up, but here you go!
- Category:Running headers with two entries and not Category:Running headers using explicit parameter names or Category:Running headers with undefined entries: https://petscan.wmflabs.org/?psid=26923100
- Category:Running headers with one entry and not Category:Running headers using explicit parameter names or Category:Running headers with undefined entries: https://petscan.wmflabs.org/?psid=26924052
- —CalendulaAsteraceae (talk • contribs) 00:05, 7 February 2024 (UTC)
- @Xover: Updated request now that there are tracking categories:
Category:Running headers with one entryI took care of these manually!- Category:Running headers with two entries
{{[running header]|left=[left text]|center=[center text]}}
→{{[running header]|[left text]|[center text]|}}
{{[running header]|center=[center text]|left=[left text]}}
→{{[running header]|[left text]|[center text]|}}
{{[running header]|left=[left text]|right=[right text]}}
→{{[running header]|[left text]||[right text]}}
{{[running header]|right=[right text]|left=[left text]}}
→{{[running header]|[left text]||[right text]}}
{{[running header]|center=[center text]|right=[right text]}}
→{{[running header]||[center text]|[right text]}}
{{[running header]|right=[right text]|center=[center text]}}
→{{[running header]||[center text]|[right text]}}
{{[running header]|1=[left text]|2=[center text]}}
→{{[running header]|[left text]|[center text]|}}
{{[running header]|2=[center text]|1=[left text]}}
→{{[running header]|[left text]|[center text]|}}
{{[running header]|1=[left text]|3=[right text]}}
→{{[running header]|[left text]||[right text]}}
{{[running header]|3=[right text]|1=[left text]}}
→{{[running header]|[left text]||[right text]}}
{{[running header]|2=[center text]|3=[right text]}}
→{{[running header]||[center text]|[right text]}}
{{[running header]|3=[right text]|2=[center text]}}
→{{[running header]||[center text]|[right text]}}
{{[running header]|[left text]|[center text]}}
→{{[running header]|[left text]|[center text]|}}
- —CalendulaAsteraceae (talk • contribs) 18:04, 20 February 2024 (UTC)
- @CalendulaAsteraceae this is a huge backlog. To make things easier with regexes, is it possible to create different tracking categories: no named parameters, left-center-right parameters, 1-2-3 parameters) Mpaa (talk) 15:36, 13 April 2024 (UTC)
- @Mpaa, I've created Category:Running headers using explicit parameter names, but I'm not aware of any way to distinguish explicit versus implicit numbered parameters. Breaking these down a bit:
- Category:Running headers with two entries and Category:Running headers using explicit parameter names: https://petscan.wmflabs.org/?psid=28015778
{{[running header]|left=[left text]|center=[center text]}}
→{{[running header]|[left text]|[center text]|}}
{{[running header]|center=[center text]|left=[left text]}}
→{{[running header]|[left text]|[center text]|}}
{{[running header]|left=[left text]|right=[right text]}}
→{{[running header]|[left text]||[right text]}}
{{[running header]|right=[right text]|left=[left text]}}
→{{[running header]|[left text]||[right text]}}
{{[running header]|center=[center text]|right=[right text]}}
→{{[running header]||[center text]|[right text]}}
{{[running header]|right=[right text]|center=[center text]}}
→{{[running header]||[center text]|[right text]}}
- Category:Running headers with two entries and not Category:Running headers using explicit parameter names: https://petscan.wmflabs.org/?psid=28015774
{{[running header]|1=[left text]|2=[center text]}}
→{{[running header]|[left text]|[center text]|}}
{{[running header]|2=[center text]|1=[left text]}}
→{{[running header]|[left text]|[center text]|}}
{{[running header]|1=[left text]|3=[right text]}}
→{{[running header]|[left text]||[right text]}}
{{[running header]|3=[right text]|1=[left text]}}
→{{[running header]|[left text]||[right text]}}
{{[running header]|2=[center text]|3=[right text]}}
→{{[running header]||[center text]|[right text]}}
{{[running header]|3=[right text]|2=[center text]}}
→{{[running header]||[center text]|[right text]}}
{{[running header]|[left text]|[center text]}}
→{{[running header]|[left text]|[center text]|}}
- Category:Running headers with two entries and Category:Running headers using explicit parameter names: https://petscan.wmflabs.org/?psid=28015778
- —CalendulaAsteraceae (talk • contribs) 22:09, 13 April 2024 (UTC)
- @Mpaa, I've created Category:Running headers using explicit parameter names, but I'm not aware of any way to distinguish explicit versus implicit numbered parameters. Breaking these down a bit:
- @CalendulaAsteraceae this is a huge backlog. To make things easier with regexes, is it possible to create different tracking categories: no named parameters, left-center-right parameters, 1-2-3 parameters) Mpaa (talk) 15:36, 13 April 2024 (UTC)
- Xover: This should not be done; it goes against the consensus stated here. This is especially so as, if I remember correctly, only you and the bot action requestor were the only editors who expressed support of the proposal. TE(æ)A,ea. (talk) 22:39, 13 April 2024 (UTC)
CalendulaAsteraceae, Xover could you remind me what happens to explicit params (left=|center=|right=)? Are they going to be phased out and so Category:Running_headers_using_explicit_parameter_names shall be emptied? Mpaa (talk) 21:09, 27 April 2024 (UTC)
- @Mpaa: left is an alias of 1, center/centre is an alias of 2, and right is an alias of 3. I would like to phase these parameters out, since their use is prone to cause errors with duplicate parameters, but it's not a high priority. —CalendulaAsteraceae (talk • contribs) 20:42, 28 April 2024 (UTC)
- cf. this edit. Why are we converting these to {{c}}? These should be perfectly fine running headers both before and after the migration, no? Xover (talk) 05:30, 29 April 2024 (UTC)
- In any case rh/1 behaviour was planned in the new version. It generates a single centered field IIRC. ShakespeareFan00 (talk) 18:11, 29 April 2024 (UTC)
- @ShakespeareFan00 which in my opinion is a bad idea. What does it achieve vs. having {{rh|xxx}}? It will only generate one more template, we will have works that on one page will use rh, on the next rv/1, then rh again ... I thought you valued consistency. Mpaa (talk) 08:36, 1 May 2024 (UTC)
- Perhaps someone can site down and decide on ONE approach then? and then make all existing usage consistent? ShakespeareFan00 (talk) 09:04, 2 May 2024 (UTC)
- Perhaps someone should do that and DOCUMENT it so tightly there cannot be arguments BEFORE any futher conversions or "repairs" are undertaken? ShakespeareFan00 (talk) 09:04, 2 May 2024 (UTC)
- The eventual goal is to have {{rh|<centered heading>}}, so that it's possible to have single field headings, albiet with a stylesheet to set the 'style' of that heading, something that's not possible with {{c}}. {{rh/1}} has a class param, and my understanding was that once current uses are standardised. {{rh/1}} get the /1 dropped.
- The need to expand 2 param calls to 3 param calls, is because the deign intent was to make 2 param calls behave as {{rh|<left heading>|<right aligned heading>}}) which is different from the current implied 2 param usage of {{rh|<left aligned heading>|<center aligned heading>}} (and hence what causes the creation of {{rh/1}}{{rh/2}}, {{rh/3}} etc.. It's to do with CSS hooks for IndexStyles as well..
- Once current use is consistently more than 3 params, rh/3, rh/2 , rh/1 (with their different behadviours etc can be re-merged.
- As I said it needs someone else to sit down and look at all the variants.
- (Aside: It would also be a LOT simply if RH wasn't supplied with formatting templates in it's input, The 'styles' applied should be set in Indexstyles, with the params being pure content. The styles are then set via IndexStyles and appropriate CSS selectors.)
- ShakespeareFan00 (talk) 14:14, 2 May 2024 (UTC)
- @ShakespeareFan00 I 100% support your last point! I can't stand templates in rh, they make parsing much more complex. Mpaa (talk) 22:23, 3 May 2024 (UTC)
- @ShakespeareFan00 which in my opinion is a bad idea. What does it achieve vs. having {{rh|xxx}}? It will only generate one more template, we will have works that on one page will use rh, on the next rv/1, then rh again ... I thought you valued consistency. Mpaa (talk) 08:36, 1 May 2024 (UTC)
- @Xover sure it would work; I was going through recent changes and it seemed to me that {{c}}<nowiki>}} is the right template in that case. It is not that we need rh everywhere just because it exists.
- Anyhow, some of my edits were reverted e.g. this, so it seems @TE(æ)A,ea. is not happy with this rh migration; I am going to stop until people are happy with it. Mpaa (talk) 20:39, 30 April 2024 (UTC)
- Hmm. Well, for the diff linked I'd used {{rh}} deliberately because it is a running header, and using {{c}} doesn't seem to provide any additional benefit or prevent any problem.
{{rh||pageno|}}
works fine and is, AIUI, supposed to keep working. So unless I'm missing something I don't think that particular case needs (or should) be changed.As for the reverts, TE(æ)A,ea. is objecting to {{rh}} (or any other template) being implemented in Lua, because they are somehow under the impression that any random contributor can maintain and modify templates like this if they are implemented in MediaWiki template syntax; and that a mainstream programming language like Lua is somehow harder to maintain. This is of course entirely unrelated to the functionality of the template, which is what we're discussing here. Xover (talk) 07:33, 1 May 2024 (UTC)- @Xover It is not a big deal, I can revert them back if you prefer that. My line of thinking is that up to yesterday also {{rh||pageno}} was supposed to be OK until it was not ... and I am sure tomorrow someone will like to replace {{rh||pageno|}} with {{rh/1|pageno}} and so on. If we already had support for {{rh|pageno}} keeping consitency between 'name' and'function' would probably be OK. Mpaa (talk) 08:29, 1 May 2024 (UTC)
- @Mpaa: No no, no need to revert anything. Right now it doesn't matter whether it uses {{c}} or {{rh}}. It's just that it seemed unnecessary, and longer term I have some ideas for how the difference in semantics might be employed for actual functionality (hence why I've elsewhere recommended that we avoid (ab)using {{rh}} for columns or margins in the page body). For example, a Gadget that manages the running headers (that would get confused by {{rh}} in the body, and unable to detect a running header using {{c}}) or a "reader mode" that gives you a book-like view for reading page-by-page that also fetches the running headers and displays them even though it operates in mainspace. Just loose thoughts, so nothing that matters near-term, but that's the context. Xover (talk) 09:00, 1 May 2024 (UTC)
- @Xover It is not a big deal, I can revert them back if you prefer that. My line of thinking is that up to yesterday also {{rh||pageno}} was supposed to be OK until it was not ... and I am sure tomorrow someone will like to replace {{rh||pageno|}} with {{rh/1|pageno}} and so on. If we already had support for {{rh|pageno}} keeping consitency between 'name' and'function' would probably be OK. Mpaa (talk) 08:29, 1 May 2024 (UTC)
- Hmm. Well, for the diff linked I'd used {{rh}} deliberately because it is a running header, and using {{c}} doesn't seem to provide any additional benefit or prevent any problem.
- @TE(æ)A,ea. are you ok with these changes or not? Because your reverted something that is not related to how the template is implemented, but more to the idea behind it. My edit would be acceptable also with the old implementation. Mpaa (talk) 08:40, 1 May 2024 (UTC)
- Mpaa: As I mentioned earlier in this discussion, I do not believe that the running header conversion scheme (particularly the one where using unnamed parameters 1 and 2 becomes left and right, as opposed to the long-running standard practice of left and center) is justified by community consensus. Bots cannot operate without justification, and here that justification is explicitly lacking. When the changes currently being made were brought up at the Scriptorium, widespread objection was held in regard to the change in unnamed parameters 1 and 2. Despite this, the users who proposed the change are continuing to enact it in the face of community consensus—no new feat for at least one of them. In any case, I vehemently object to any such change to any project in which I am involved and in which I am working, such as Kojiki (by your example). TE(æ)A,ea. (talk) 17:03, 2 May 2024 (UTC)
- Okay let me blunt, What is your "actual" concern with expanding all current usages of rh to 3 or more parameters?
- ShakespeareFan00 (talk) 18:56, 2 May 2024 (UTC)
- ShakespeareFan00: It’s completely pointless and a massive waste of resources. People who deal with coding and other Wikisource backend (the above contributors) could do something productive; instead they spend days and weeks trying to change this template, which will require 165,000+ pages to be edited, and will produce absolutely no benefit. This isn’t even about the Lua change, at this point; the two-parameter system currently in place could be carried over. It’s basically two users, without (if not against) consensus, undertaking to make hundreds of thousands of edits and break workflow for, I would say, most active editors, for no benefit to the project. I do, also, object to the change to Lua, for the reasons I have stated before (and which Xover mocked above). The use of modules should be avoided as much as possible, and templates should certainly not be changed to modules when there is no need to do so, as here. TE(æ)A,ea. (talk) 19:30, 2 May 2024 (UTC)
- Mpaa: As I mentioned earlier in this discussion, I do not believe that the running header conversion scheme (particularly the one where using unnamed parameters 1 and 2 becomes left and right, as opposed to the long-running standard practice of left and center) is justified by community consensus. Bots cannot operate without justification, and here that justification is explicitly lacking. When the changes currently being made were brought up at the Scriptorium, widespread objection was held in regard to the change in unnamed parameters 1 and 2. Despite this, the users who proposed the change are continuing to enact it in the face of community consensus—no new feat for at least one of them. In any case, I vehemently object to any such change to any project in which I am involved and in which I am working, such as Kojiki (by your example). TE(æ)A,ea. (talk) 17:03, 2 May 2024 (UTC)
- @TE(æ)A,ea. are you ok with these changes or not? Because your reverted something that is not related to how the template is implemented, but more to the idea behind it. My edit would be acceptable also with the old implementation. Mpaa (talk) 08:40, 1 May 2024 (UTC)
Replace some uses of Template:S with Template:Long s
- This section was archived on a request by: —CalendulaAsteraceae (talk • contribs) 20:12, 14 January 2025 (UTC)
In pages that link to Template:S, please replace {{s}}
with {{ls}}
(simpler template, no change to output). —CalendulaAsteraceae (talk • contribs) 01:39, 14 January 2025 (UTC)