Content deleted Content added
Undid revision 1264223588 by 188.236.228.176 (talk) |
No edit summary Tag: Reverted |
||
Line 2:
{{Module rating|p}}
{{cascade-protected template|page=module}}
{{Lua|Module:If preview|noprotcat=
'''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 ==
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} K9}
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|
For an explicit red
* {{mlx|Check for unknown parameters|check|unknown{{=}}<span class{{=}}"error">Sorry, I don't recognize _VALUE_</span>|arg1|arg2|
To use Lua patterns, use:
Line 32 ⟶ 31:
* <code>arg1</code>, <code>arg2</code>, ..., <code>argN</code>, are the known parameters.
* Unnamed (positional) parameters can be added too: <code>|1|2|arg1|arg2|...</code>.
* [[:mw:Extension:Scribunto/Lua reference manual#Patterns|Lua patterns]] (similar to [[regular expression]]s) usage with parameters is also supported (such as: {{para|regexp1|header[%d]+}}, {{para|regexp2|date[1-
* {{para|unknown}} – what happens when an unknown parameter is used. Typically use either a tracking category to place pages that use unknown parameters, or an error.
* {{para|preview}} – the text to be displayed when in preview mode and an unknown parameter is used.
|