![]() | To help centralize discussions and keep related topics together, all Wikipedia:Lua subpages' talk pages and Help talk:Lua redirect here. |
![]() | The contents of Wikipedia:Lua/Requests was merged into Wikipedia talk:Lua on 5 February 2016. The former page's history now serves to provide attribution for that content in the latter page, and it must not be deleted as long as the latter page exists. |
![]() | Wikipedia:Lua/To do was nominated for deletion on 21 May 2015. The result of the discussion was keep. |
This page has archives. Sections older than 90 days may be automatically archived by ClueBot III when more than 1 section is present. |
Wikipedia:Lua#Unit testing says, "By convention, unit tests for a module like Module:Example are placed in Module:Example/testcases, and are executed on Module talk:Example/testcases." Where was this convention established, and how come it was agreed that it's OK to repurpose a talk page that is supposed to be a place to discuss a corresponding page? —Anomalocaris (talk) 19:31, 25 April 2025 (UTC)
I'm moving this from a declined Phab ticket (T395879) , given that phabricator focuses on changes in Mediawiki as opposed to User side Scribunto modules, which it is clear this would be implemented as:-
"Feature summary (what you would like to be able to do and where):
Mix two colors based on their XYZ or RGB values, using a subtractive model such as (Kubelka-Munk theory), generating a result which can be supplied as a color in situations where a CSS color would typically be provided.
Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
The specfic use case is at: https://en.wikisource.orghttps://demo.azizisearch.com/lite/wikipedia/page/Page:The_color_printer_(1892).djvu/29 where the 'mixed' inks are based on a 'parts' mix of 2 or more defined base inks.
The current approach https://en.wikisource.orghttps://demo.azizisearch.com/lite/wikipedia/page/Module:The_Color_Printer_tone and https://en.wikisource.orghttps://demo.azizisearch.com/lite/wikipedia/page/Module:The_Color_Printer_tone/data uses as weighted blend as an interim measure ( this is understood to be an additive approach and thus may not reflect the behaviour intended in the original printed work.)
Benefits (why should this be implemented?):
Being able to mix color subtractively would assist in being able to potentially more accurately determine and transcribe diagramatic colors in older works. The desire for an algorithmic approach, would reduce the need to manually determine mixes, and allow for colors to be adjusted en-masse in a single location, if the 'base' inks were 'corrected' to account for efforts to 'defade' them.
A MIT Licensed library Spectral.JS exists. (https://github.com/rvanwijnen/spectral.js) which if adapted into a set of functions in a Module:Colormix that could be called from the above mentioned module, would meet the use case quite well.
Beyond the specfic use case provided, being able to support a 'subtractive' (albiet approximated model) more directly would assist various color theory topics on other Wikimedia projects."
I've asked here because I felt a module like this might have wider applicability. ShakespeareFan00 (talk) 06:43, 4 June 2025 (UTC)
I am trying to use string.gsub to replace space characters with %20
to make a URL work correctly. However gsub sees the %2 and treats it as a capture. I've tried escaping things like %%20
and %%%20
. Any suggestions please? — Martin (MSGJ · talk) 13:48, 12 June 2025 (UTC)
%%20
didn't solve the issue? Make sure you replace capturing terms on both the matching string and the replacement string, since both can use capture group references. If it still doesn't work, could you point to the code where this happens? Aidan9382 (talk) 14:37, 12 June 2025 (UTC)=string.gsub ("t t", ' ', '%%20')
in the debug console, I get t%20t
. That's what you want, right? Also, if you don't need to know how many space characters were replaced: mw:Extension:Scribunto/Lua reference manual#mw.uri.encode: =mw.uri.encode ('t t', 'PATH')
→ t%20t
I recently rewrote {{OSM Location map}} in Lua (vastly improved performance along with extra features). I have now been asked on the talk page if it might be available via commons to allow other language wikis to use it. Is that an option? and is it desirable? The template has a small amount of embeded bits of text, grouped together to make at least superficial translation possible. For that, plus the documentation, a pasted and customised language specific versions seem to me to make more sense. (A full-blown translation of all parameters etc would be a major piece of work, though).
Having looked at a couple of the 49 versions already on other language wikis, these appear to still be the old template version (or in some cases the 'graph' based broken version of 3 years ago). Is there any mechanism for these to update to the lua module in some way? or alerting someone at the relevant wikis? Thanks for any insights on these issues. RobinLeicester (talk) 22:57, 12 June 2025 (UTC)
colorCap
which is an undefined global used once. Johnuniq (talk) 09:26, 13 June 2025 (UTC)Thanks to Tule-hog's work at Template talk:Copied#Backend rewrite, the backend of {{Afd-merged-from}} can be rewritten to invoke Module:Copied, much like the rewrite at Template talk:Merged-from#Backend rewrite. Because I have zero experience in such matters: is this a bad idea? If potentially controversial, would I ask VPT or some other venue? FWIW, consensus for rewriting {{merged-from}} was assessed at Wikipedia:Templates for discussion/Log/2025 March 12#Template:Merged-from (no consensus against rewriting the backend of the merged-from template, so long as it doesn't affect functionality
). Thanks in advanced! Rotideypoc41352 (talk · contribs) 19:02, 16 June 2025 (UTC)
The discussion was closed on {{{3}}}missing from the merged-from lookalikes?
{{Afd-merged-from/sandbox}}
documents a normal merge unrelated to a deletion discussion. Should it instead assume the AfD page name and the merge source are the same? That is, adding {{{1}}}}
to form |afd1={{{afd|{{{afd1|{{{2|{{{1}}}}}}}}}}}}
?