Jump to content

Module talk:Check for unknown parameters

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 06:38, 1 March 2023 (Archiving 1 discussion(s) to Module talk:Check for unknown parameters/Archive 1) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconTemplates
WikiProject iconThis module is within the scope of WikiProject Templates, a group dedicated to improving the maintenance of Wikipedia's templates. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Note icon
This template should only be transcluded in the Wikipedia talk, Help talk, or Category talk namespace(s).

Use from module

Is it possible to use this module directly from another module, or does it always need to be placed on a template page? — Martin (MSGJ · talk) 16:11, 30 December 2022 (UTC)[reply]

@Frietjes: any chance you could help me with the above? — Martin (MSGJ · talk) 19:04, 8 January 2023 (UTC)[reply]
Something like this should work for you:
	local validArgs = { ... }
	local checkForUnknownParameters = require("Module:Check for unknown parameters")
	local result = checkForUnknownParameters._check(validArgs, args)
Gonnym (talk) 11:41, 9 January 2023 (UTC)[reply]
MSGJ, see the end of Module:Rugby box for a simple example or Module:Infobox3cols or Module:Flag for more complicated examples. Frietjes (talk) 15:50, 9 January 2023 (UTC)[reply]
Thanks both, I will give it a try — Martin (MSGJ · talk) 12:10, 11 January 2023 (UTC)[reply]

Works great. I will add instructions to the documentation when I get time. Non-urgent feature request: it would be nice if I could specify which namespaces I want to check unknown parameters in. Easy enough to do locally of course, but would be tidier if it was in this module. — Martin (MSGJ · talk) 13:15, 11 January 2023 (UTC)[reply]

Pagenames involved

For de-confusion, pagenames involved:

-DePiep (talk) 07:37, 28 February 2023 (UTC)[reply]