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 Hilst (talk | contribs) at 17:01, 13 October 2023 (top: Removed {{WikiProject Templates}}, it should only be transcluded in the Wikipedia talk, Help talk, or Category talk namespace(s)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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]