<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://159.13.49.45/index.php?action=history&amp;feed=atom&amp;title=Module%3ACheck_for_unknown_parameters%2Fdoc</id>
	<title>Module:Check for unknown parameters/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://159.13.49.45/index.php?action=history&amp;feed=atom&amp;title=Module%3ACheck_for_unknown_parameters%2Fdoc"/>
	<link rel="alternate" type="text/html" href="http://159.13.49.45/index.php?title=Module:Check_for_unknown_parameters/doc&amp;action=history"/>
	<updated>2026-04-04T00:47:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://159.13.49.45/index.php?title=Module:Check_for_unknown_parameters/doc&amp;diff=823&amp;oldid=prev</id>
		<title>Nat: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://159.13.49.45/index.php?title=Module:Check_for_unknown_parameters/doc&amp;diff=823&amp;oldid=prev"/>
		<updated>2025-04-07T11:07:28Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:07, 7 April 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key mediawiki:diff:1.41:old-822:rev-823 --&gt;
&lt;/table&gt;</summary>
		<author><name>Nat</name></author>
	</entry>
	<entry>
		<id>http://159.13.49.45/index.php?title=Module:Check_for_unknown_parameters/doc&amp;diff=822&amp;oldid=prev</id>
		<title>wikipedia&gt;Annh07: Reverted edit by 2001:D08:1391:1BDF:6226:D3B1:EBFC:9742 (talk) to last version by Gonnym</title>
		<link rel="alternate" type="text/html" href="http://159.13.49.45/index.php?title=Module:Check_for_unknown_parameters/doc&amp;diff=822&amp;oldid=prev"/>
		<updated>2025-02-15T14:18:41Z</updated>

		<summary type="html">&lt;p&gt;Reverted edit by &lt;a href=&quot;/index.php/Special:Contributions/2001:D08:1391:1BDF:6226:D3B1:EBFC:9742&quot; title=&quot;Special:Contributions/2001:D08:1391:1BDF:6226:D3B1:EBFC:9742&quot;&gt;2001:D08:1391:1BDF:6226:D3B1:EBFC:9742&lt;/a&gt; (&lt;a href=&quot;/index.php?title=User_talk:2001:D08:1391:1BDF:6226:D3B1:EBFC:9742&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:2001:D08:1391:1BDF:6226:D3B1:EBFC:9742 (page does not exist)&quot;&gt;talk&lt;/a&gt;) to last version by Gonnym&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Used in system}}&lt;br /&gt;
{{Module rating|p}}&lt;br /&gt;
{{cascade-protected template|page=module}}&lt;br /&gt;
{{Lua|Module:If preview|noprotcat=yes}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Module:Check for unknown parameters&amp;#039;&amp;#039;&amp;#039; 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.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
=== From a template ===&lt;br /&gt;
To sort entries into a tracking category by parameter, use:&lt;br /&gt;
* {{mlx|Check for unknown parameters|check|unknown{{=}}&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[Category:Some tracking category|_VALUE_]]|arg1|arg2|arg3|argN}}&lt;br /&gt;
&lt;br /&gt;
To sort the entries into a tracking category by parameter with a preview error message, use:&lt;br /&gt;
* {{mlx|Check for unknown parameters|check|unknown{{=}}&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[Category:Some tracking category|_VALUE_]]|preview{{=}}unknown parameter &amp;quot;_VALUE_&amp;quot;|arg1|arg2|...|argN}}&lt;br /&gt;
&lt;br /&gt;
For an explicit red error message, use:&lt;br /&gt;
* {{mlx|Check for unknown parameters|check|unknown{{=}}&amp;amp;lt;span class{{=}}&amp;quot;error&amp;quot;&amp;gt;Sorry, I don&amp;#039;t recognize _VALUE_&amp;amp;lt;/span&amp;gt;|arg1|arg2|...|argN}}&lt;br /&gt;
&lt;br /&gt;
To use Lua patterns, use:&lt;br /&gt;
* {{mlx|Check for unknown parameters|check|unknown{{=}}&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[Category:Some tracking category|_VALUE_]]|preview{{=}}unknown parameter &amp;quot;_VALUE_&amp;quot;|arg1|arg2|...|argN|regexp1{{=}}header[%d]+|regexp2{{=}}date[1-9]}}&lt;br /&gt;
&lt;br /&gt;
===From a module===&lt;br /&gt;
To call from a module, use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local checkForUnknownParameters = require(&amp;quot;Module:Check for unknown parameters&amp;quot;)&lt;br /&gt;
local result = checkForUnknownParameters._check(validArgs, args)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where the first set of args are the module args below and the second set of args are the parameters that are checked.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
* &amp;lt;code&amp;gt;arg1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;arg2&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;argN&amp;lt;/code&amp;gt;, are the known parameters.&lt;br /&gt;
* Unnamed (positional) parameters can be added too: &amp;lt;code&amp;gt;|1|2|arg1|arg2|...&amp;lt;/code&amp;gt;.&lt;br /&gt;
* [[: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-9]}}, {{para|regexp3|data[%d]+[abc]?}}). This is useful when there are many known parameters which use a systematic pattern.&lt;br /&gt;
* {{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.&lt;br /&gt;
* {{para|preview}} – the text to be displayed when in preview mode and an unknown parameter is used.&lt;br /&gt;
* The &amp;lt;code&amp;gt;_VALUE_&amp;lt;/code&amp;gt; keyword, if used, will be changed to the name of the parameter. This is useful for either sorting the entries in a tracking category, or for provide more explicit information.&lt;br /&gt;
* {{para|ignoreblank|1}} – by default, the module makes no distinction between a defined-but-blank parameter and a non-blank parameter. That is, both unlisted {{Para|foo|x}} and {{Para|foo}} are reported. To only track non-blank parameters use {{para|ignoreblank|1}}.&lt;br /&gt;
* {{para|showblankpositional|1}} – by default, the module ignores blank positional parameters. That is, an unlisted {{para|2}} is ignored. To {{em|include}} blank positional parameters in the tracking use {{para|showblankpositional|1}}.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
{{Infobox&lt;br /&gt;
| above = {{{name|}}}&lt;br /&gt;
&lt;br /&gt;
| label1 = Height&lt;br /&gt;
| data1 = {{{height|}}}&lt;br /&gt;
&lt;br /&gt;
| label2 = Weight&lt;br /&gt;
| data2 = {{{weight|}}}&lt;br /&gt;
&lt;br /&gt;
| label3 = Website&lt;br /&gt;
| data3 = {{{website|}}}&lt;br /&gt;
}}&amp;lt;!-- &lt;br /&gt;
  end infobox, start tracking&lt;br /&gt;
--&amp;gt;{{#invoke:Check for unknown parameters|check&lt;br /&gt;
| unknown = {{Main other|[[Category:Some tracking category|_VALUE_]]}}&lt;br /&gt;
| preview = unknown parameter &amp;quot;_VALUE_&amp;quot; | height | name | website | weight &lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Call from within Lua code==&lt;br /&gt;
See the end of [[Module:Rugby box]] for a simple example or [[Module:Infobox3cols]] or [[Module:Flag]] for more complicated examples. &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* {{Clc|Unknown parameters}} (category page can have header {{tl|Unknown parameters category}})&lt;br /&gt;
* [[Module:Params]] – for complex operations involving parameters&lt;br /&gt;
* [[Template:Checks for unknown parameters]] – adds documentation to templates using this module&lt;br /&gt;
* [[Module:Check for deprecated parameters]] – similar module that checks for deprecated parameters&lt;br /&gt;
* [[Module:Check for clobbered parameters]] – module that checks for conflicting parameters&lt;br /&gt;
* [[Module:TemplatePar]] – similar function (originally from dewiki)&lt;br /&gt;
* [[Template:Parameters]] and [[Module:Parameters]] – generates a list of parameter names for a given template&lt;br /&gt;
* [[Project:TemplateData]] based template parameter validation&lt;br /&gt;
* [[Module:Parameter validation]] checks a lot more&lt;br /&gt;
* [[User:Bamyers99/TemplateParametersTool]] - A tool for checking usage of template parameters&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories go here and interwikis go in Wikidata. --&amp;gt;&lt;br /&gt;
[[Category:Modules that add a tracking category]]&lt;br /&gt;
[[Category:Template metamodules]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Module documentation pages]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Annh07</name></author>
	</entry>
</feed>