[06:30:53] !issync [06:30:54] Syncing #mediawiki (requested by legoktm) [06:30:56] Set /cs flags #mediawiki *!*@libera/staff/* -o [06:30:58] Set /cs flags #mediawiki [1997kB] +Aiotv [06:31:02] oops [06:33:25] !issync [06:33:26] Syncing #mediawiki (requested by legoktm) [06:33:28] Set /cs flags #mediawiki *!*@libera/staff/* +o [06:33:30] Set /cs flags #mediawiki litharge +o [08:20:04] [1997kB] : pretty :) [08:21:25] <[1997kB]> yeah but on android app it looks bad. Looks like png will work better. [08:48:49] <[1997kB] "yeah but on android app it looks"> Looks nice in light mode now, good enough in dark mode. Guess there's no version that will look good in both [09:14:32] <[1997kB]> yeah, tried one including MediaWiki text also but only this one fits best. [12:29:41] Hi, I have updated mw 1.31 to 1.35 and I have some old code which throws now an error --> Call to undefined method MagicWord::get() <-- did they remove MagicWords? [12:29:51] Is there now an alternative? [12:29:57] They did not remove MagicWords, no [12:30:51] If you look at the RELEASE-NOTES/HISTORY [12:31:11] >* The remaining static methods for MagicWord, deprecated in 1.32, were removed. These were MagicWord::get(), ::getSubstIDs(), ::getDoubleUnderscoreArray(), ::getVariableIDs(), and ::getCacheTTL(). Instead, use MagicWordFactory (via MediaWikiServices). [12:33:14] So I need to replace MagicWords with MagicWordFactory? [12:33:22] So use MagicWordFactory::get() ? [12:33:41] ->get(), but yes [12:34:04] ok let me check [12:46:16] Reedy I get now "syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')'" the line is "$toc = preg_match(MagicWordFactory->get('toc')->getRegex(), $text);" It's not my code, I'm just trying to upgrade MW to 1.35. Can you maybe help again? [12:46:31] That's not how you use it [12:47:03] how then? [12:47:49] You need something like... MediaWiki\MediaWikiServices::getInstance()->getMagicWordFactory()->get() [12:49:19] =$ [16:36:18] Re: https://phabricator.wikimedia.org/T282896. As I commented at the bottom of the task, the MediaWiki-Docker instructions as currently written have caused the reported bug. It appears to me that there are 2 solutions: (1) Change the instructions by eliminating setting MW_DOCKER_UID/MW_DOCKER_GID; or (2) create a bogus UID 1000 with code similar to "useradd -u 1000 -U bogus". The second approach WFM. [19:41:21] Question: Does anyone know of a template that takes in some parameters, and returns them back, as-is, while *preserving white space*? [19:41:28] Something like https://www.mediawiki.org/wiki/Extension:Pipe_Escape [19:41:50] but implemented as a template, and not an extension (as I do not have admin privileges on the wiki in question) [19:42:33] Background: I am trying to use that as a technique to help template callers avoid escaping the pipe character via {{!}} [19:42:57] I believe it would be pretty straightforward to implement, but I am trying to avoid re-inventing the wheel [19:43:38] Guest53: do you need to preserve leading and trailing white space? [19:47:46] anyway, template parameters preserve whitespace by default. If you're seeing leading/trailing whitespace trimmed out, that would be due to the use of parser functions [19:48:26] only solution there is to not pass those parameters to parser functions (such as by fetching them in a scribunto module instead) [19:48:53] Yes - Ideally I would need to preserve white spaces [19:50:23] so call the template, then have the template immediately pass the numbered params {{{1|}}} and so on to a lua module? [19:51:17] don't pass to the lua module, since #invoke is a parser function and will therefore strip whitespace [19:51:33] lua can read arguments passed to the parent template without having to explicitly pass them on to lua [19:51:33] I am seeing the white spaces trimmed out while just using things like {{#if: {{{2|}}}|{{!}}{{{2|}}}}} for example [19:51:38] are those parser functions? [19:51:44] if it starts with #, it's a parser function [19:52:12] so, yes, #if is a parser function [19:52:24] Okay - so the {{#if}} is a parser function, but the {{{2|}}} inside it should not trim the white space tho - correct? [19:52:38] parser functions trim whitespace of everything passed into them [19:52:42] or is it too late for the {{{2|}}} since it's already inside the {{#if: }} [19:52:45] yep [19:52:46] I see ok [19:53:05] so maybe use the Template:If version instead? [19:53:19] or use lua :) [19:53:33] you can get the parent frame to access {{{2}}} without whitespace being trimmed [19:53:40] you mean use lua from the outset, instead of asking the users to call the template first? [19:53:45] oh... I see [19:53:52] call a template, and then the template itself has the lua call [19:54:21] so #invoke my new lua module, get the numbered params directly from lua, and they will have the whitespace [19:54:28] indeed [19:54:33] Sounds like a plan [19:54:40] assuming you get them from the parent frame [19:54:41] and again the code would be super straightforward [19:54:52] Gotcha [19:54:53] if you get them from the current frame (i.e. stuff passed to lua directly), the whitespace will be trimmed [19:55:11] and this hasn't been done already by anyone before as best as people know? [19:55:21] it's probably on Wikipedia somewhere [19:55:35] but I wouldn't have the first idea of where to look :( [19:55:36] > if you get them from the current frame (i.e. stuff passed to lua directly), the whitespace will be trimmed [19:55:39] ^^ understood [19:55:45] This is super helpful [19:55:48] I can't thank you enough [19:55:52] 👍 [19:57:32] Just so I am clear on the syntax for accessing parent frames from lua [19:57:36] is it similar to this: [19:57:37] https://www.mediawiki.org/wiki/Extension:Scribunto/Parser_interface_design#Parent_frame_access [19:58:47] local p = {} [19:58:47] function p.function_name( frame ) [19:58:48] -- Get arg1 [19:58:49] local arg1 = frame.args[1] [19:58:49] -- Get name1 [19:58:49] local name1 = frame.args.name1 [19:58:50] -- Put all arguments into a real table [19:58:50] local t = {} [19:58:51] for name, value in frame:argumentPairs() do [19:58:51] t[name] = value [19:58:52] end [19:59:09] Guest53: please use a pastebin in the future [19:59:51] Guest53: https://www.mediawiki.org/wiki/Module:Arguments#L-110 [20:00:18] (actually you may just want to use that module wholesale from within your module) [20:07:03] legoktm - thanks; will do [20:07:29] Nice... Thanks moonmoon