Content deleted Content added
No edit summary Tags: Reverted Mobile edit Mobile web edit |
m Reverted edits by 109.177.178.255 (talk) (HG) (3.4.12) |
||
Line 1:
{{Used in system}}
{{Module rating|p}}
{{cascade-protected template|page=module}}
{{Lua|Module:If preview|noprotcat=yes}}
'''Module:Check for unknown parameters''' is used to check for uses of unknown parameters in a template or module. It may be appended to a template at the end or called directly from a module.
== Usage ==
=== From a template ===
To sort entries into a tracking category by parameter, use:
* {{mlx|Check for unknown parameters|check|unknown{{=}}<nowiki>[</nowiki>[Category:Some tracking category|_VALUE_]]|arg1|arg2|arg3|argN}}
To sort the entries into a tracking category by parameter with a preview error message, use:
* {{mlx|Check for unknown parameters|check|unknown{{=}}<nowiki>[</nowiki>[Category:Some tracking category|_VALUE_]]|preview{{=}}unknown parameter "_VALUE_"|arg1|arg2|...|argN}}
For an explicit red error message, use:
* {{mlx|Check for unknown parameters|check|unknown{{=}}<span class{{=}}"error">Sorry, I don't recognize _VALUE_</span>|arg1|arg2|...|argN}}
To use Lua patterns, use:
* {{mlx|Check for unknown parameters|check|unknown{{=}}<nowiki>[</nowiki>[Category:Some tracking category|_VALUE_]]|preview{{=}}unknown parameter "_VALUE_"|arg1|arg2|...|argN|regexp1{{=}}header[%d]+|regexp2{{=}}date[1-9]}}
===From a module===
To call from a module, use:
<syntaxhighlight lang="lua">
local checkForUnknownParameters = require("Module:Check for unknown parameters")
local result = checkForUnknownParameters._check(validArgs, args)
</syntaxhighlight>
Where the first set of args are the module args below and the second set of args are the parameters that are checked.
== Parameters ==
* <code>arg1</code>, <code>arg2</code>, ..., <code>argN</code>, are the known parameters.
|