Wikisource:Administrators' noticeboard/Archives/2024

From Wikisource
Jump to navigation Jump to search
Warning 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.

The following discussion is closed:

Globally locked.

VOA and XWA, I already reverted many of their edits. MathXplore (talk) 07:55, 25 January 2024 (UTC)

Globally locked.--Prosfilaes (talk) 19:04, 25 January 2024 (UTC)
This section was archived on a request by: Prosfilaes (talk) 19:06, 25 January 2024 (UTC)

{{Header}} has an illustrator parameter now, so I would like to replace | override_author = [[Author:Beatrix Potter|Beatrix Potter]], illustrated by [[Author:Virginia Albert|Virginia Albert]] with |illustrator = Virginia Albert. —CalendulaAsteraceae (talkcontribs) 17:45, 22 February 2024 (UTC)

Protected edit request for Template:Progress bar

This section was archived on a request by: —CalendulaAsteraceae (talkcontribs) 02:35, 16 March 2024 (UTC)

I've created Module:Progress bar, which implements {{progress bar}} in Lua (and adds support for changing the width of the bar). I've tested this at Template:Sandbox and as far as I can tell everything works. Assuming there's nothing I've missed, I'd like for Template:Progress bar to be edited to this:

<templatestyles src="Progress bar/styles.css" />
<includeonly>{{#invoke:Progress bar|progress_bar
|total={{{total|}}}
|validated={{{validated|}}}
|proofread={{{proofread|}}}
|not_proofread={{{not proofread|}}}
|problematic={{{problematic|}}}
|notext={{{notext|}}}
|height={{{height|}}}
|width={{{width|}}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>

Thank you! —CalendulaAsteraceae (talkcontribs) 08:06, 30 May 2022 (UTC)

@CalendulaAsteraceae FYI, I don't think you need to verbosely pass through all the parameters: you're using Module:Arguments which happily pulls the arguments out of the mw.getCurrentFrame().getParent(). All you should need is {{#invoke:Progress bar|progress_bar}} (I think) Inductiveloadtalk/contribs 19:52, 31 May 2022 (UTC)
@Inductiveload Awesome, thank you! —CalendulaAsteraceae (talkcontribs) 21:31, 31 May 2022 (UTC)
Updated edit request:
<templatestyles src="Progress bar/styles.css" />
<includeonly>{{#invoke:Progress bar|progress_bar}}</includeonly><noinclude>
{{documentation}}
</noinclude>
CalendulaAsteraceae (talkcontribs) 09:18, 4 June 2022 (UTC)
@Inductiveload, does the above code look good to you? —CalendulaAsteraceae (talkcontribs) 06:56, 22 July 2022 (UTC)
Still interested in this. —CalendulaAsteraceae (talkcontribs) 05:05, 7 August 2022 (UTC)
@CalendulaAsteraceae: You might want to consider something like: <includeonly>{{#invoke:Progress bar|progress_bar|_ts=<templatestyles src="Progress bar/styles.css" />}}</includeonly><noinclude>{{documentation}}</noinclude>. Although you can have Lua code call extension tags directly, I have found it is often better to pass them as an argument to the #invoke when possible (it also helps limit the Scribunto expansion depth). —Uzume (talk) 21:39, 3 November 2023 (UTC)
@Uzume: Interesting. Can you expand a bit on why you find that better? Expansion depth and other optimisation concerns seem fairly irrelevant for this use case, and at first blush that seems like a more complicated and fragile approach. But it definitely wouldn't be the first time I've missed the germane point. :)
@CalendulaAsteraceae: I've completely missed this request, sorry. For stuff like this please do feel free to ping me directly (including on my talk page), and to nag me periodically if I do not respond. I am personally very motivated to enable technical contributors to work efficiently even if they lack +sysop (more technical hands make my work load lighter) so far from minding such requests and nagging I actually appreciate it. Especially if I am being lame about responding. Xover (talk) 09:11, 4 November 2023 (UTC)
@Xover: Well, I agree that expansion depth might not be much of an issue for this problem set (at least today: things have a way of ending up doing things they were not originally intended/designed for), but I believe passing extension tags as strip markers in an argument to #invoke gives better flexibility. I suppose one could use frame:getTitle() as a basename for stylesheet and then use frame:extensionTag() (or similar) to accomplish a similar end. —Uzume (talk) 10:25, 4 November 2023 (UTC)
But why not just invoke templatestyles in the template layer? Or if you need it in Lua for some reason (which I don't quite see here, but does happen when you need logic to decide which stylesheet to apply), why not just pass a page name, relative or absolute? Xover (talk) 10:30, 4 November 2023 (UTC)
@Xover: Those are certainly valid options but those tend be more fragile (since they are separate from the module invocation) and do not provide the flexibility or control of my suggestion (which does invoke templatestyles in the template layer and then passes it to the Scribunto module). It was only a suggestion for consideration—one often overlooked. My suggestion also allows the module to decide when and where (and even if) to place the templatestyles argument while freeing it from having to consider the templatestyles page location (which if otherwise handled in the module would need to either be passed, hardcoded or calculated, e.g., from frame:getTitle() or something). —Uzume (talk) 16:51, 4 November 2023 (UTC)
@Uzume: I am not convinced of this approach, but that may simply be because I am not seeing the use case or the limitations of the alternatives. I'll keep it in mind while I am tooling around so hopefully the lightbulb will suddenly come on at some point. :) Thanks for the info / suggestion / discussion in any case. `preciated. Xover (talk) 07:27, 8 November 2023 (UTC)
@Xover: I don't have a strong opinion on whether to put the templatestyles in the module as opposed to the template layer, but could you make the basic edit to use the module?
<templatestyles src="Progress bar/styles.css" /><includeonly>{{#invoke:Progress bar|progress_bar}}</includeonly><noinclude>{{documentation}}</noinclude>
CalendulaAsteraceae (talkcontribs) 04:10, 8 November 2023 (UTC)
@CalendulaAsteraceae: Could you take a look at the test cases in Template:Progress bar/testcases first? There are some differences in output that I am not sure are deliberate, and some of the failure modes with bad input appear distinctly worse. You may also want to think about whether the current tests exercise all parts of Module:Progress bar and whether additional tests could be constructed to improve coverage.
On the behaviour with garbage input: right now the module passes the garbage on to its underlying modules and libraries, and when they predictably blow up the module just falls flat. It would be better to detect as many of these bad inputs as reasonably possible and terminate in a controlled fashion with a useful message to the user invoking it. Xover (talk) 07:22, 8 November 2023 (UTC)
@Xover: Thank you for this feedback! I've added some error messages. The different order of the bars is intentional; I made it match the order of the page status menu. The width parameter is also an intentional addition. —CalendulaAsteraceae (talkcontribs) 06:04, 9 November 2023 (UTC)
@CalendulaAsteraceae: Done Xover (talk) 06:58, 9 November 2023 (UTC)
Thank you! —CalendulaAsteraceae (talkcontribs) 07:02, 9 November 2023 (UTC)

Edit request for Template:Biblecontents

I've edited {{biblecontents}} to use {{flatlist}}. My code is in {{biblecontents/sandbox}} and the test cases look good, so I'd appreciate these changes being propagated to the main template. —CalendulaAsteraceae (talkcontribs) 07:50, 20 January 2024 (UTC)

Done
This section was archived on a request by: —CalendulaAsteraceae (talkcontribs) 02:46, 16 March 2024 (UTC)