<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://www.vigyanwiki.in/index.php?action=history&amp;feed=atom&amp;title=Module%3AParameterCount%2Fdoc</id>
	<title>Module:ParameterCount/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.vigyanwiki.in/index.php?action=history&amp;feed=atom&amp;title=Module%3AParameterCount%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:ParameterCount/doc&amp;action=history"/>
	<updated>2026-04-28T01:34:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:ParameterCount/doc&amp;diff=18731&amp;oldid=prev</id>
		<title>Admin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:ParameterCount/doc&amp;diff=18731&amp;oldid=prev"/>
		<updated>2022-10-18T04:09:41Z</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;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:39, 18 October 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:ParameterCount/doc&amp;diff=18730&amp;oldid=prev</id>
		<title>wikipedia&gt;Mr. Stradivarius: /* all */ ce</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:ParameterCount/doc&amp;diff=18730&amp;oldid=prev"/>
		<updated>2015-11-25T06:32:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;all: &lt;/span&gt; ce&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This module counts the number of parameters that are passed to a template. For example, you might put the code &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:ParameterCount|all}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; inside the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{my template}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; template. If you then use &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{my template}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{my template&lt;br /&gt;
| one&lt;br /&gt;
| two&lt;br /&gt;
| three&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:ParameterCount|all}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; code inside the template will give the result &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This module can be configured to count all parameters, or specific parameters defined by a template author. This module is only useful in templates. It should not be used on non-template pages.&lt;br /&gt;
&lt;br /&gt;
The module has two functions available, &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== all ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; function is used to count all parameters specified when using a template, regardless of whether or not they are used in the template itself.&lt;br /&gt;
&lt;br /&gt;
'''Usage'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{#invoke:ParameterCount|all}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Examples'''&lt;br /&gt;
&lt;br /&gt;
If the code &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:ParameterCount|all}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; was added to the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{my example template}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; template, the code &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{my example template|1|2|foo=bar}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; would make ParameterCount produce &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== main ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function is used to count parameters with specific names. There are two ways of specifying parameters: by name, and using Lua patterns.&lt;br /&gt;
&lt;br /&gt;
'''By name'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{#invoke:ParameterCount|main|1|2|3|abc|def}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To specify a parameter by name, add the parameter name as a positional parameter.&lt;br /&gt;
&lt;br /&gt;
'''By pattern'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{#invoke:ParameterCount|main|pattern1=^param%d+$|pattern2=^abc}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To specify parameters by Lua Ustring pattern, add the pattern to {{para|pattern1}}, {{para|pattern2}} etc. For information on constructing Lua patterns, see the [http://lua-users.org/wiki/PatternsTutorial Lua Users' Wiki pattern tutorial], as well as the Lua reference manual sections on [[mw:Extension:Scribunto/Lua_reference_manual#Patterns|Lua patterns]] and [[mw:Extension:Scribunto/Lua_reference_manual#Ustring_patterns|Ustring patterns]].&lt;br /&gt;
&lt;br /&gt;
'''Examples'''&lt;br /&gt;
&lt;br /&gt;
If the code &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:ParameterCount|main|1|2|abc}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; was added to the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{my example template}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; template, the code &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{my example template|1|2|abc=some value|other=some other value}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; would make ParameterCount produce &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the code &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:ParameterCount|main|pattern1=^param%d+$}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; was added to the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{my example template}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; template, the code &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{my example template|param1=a value|param2=another value|param5=yet another value}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; would make ParameterCount produce &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Checking for blanks ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{#invoke:ParameterCount|all|checkblanks=no}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{#invoke:ParameterCount|main|checkblanks=no}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, the module doesn't count parameters whose values contain only whitespace, e.g. {{para|abc|&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;}}. If you wish to count all parameters, regardless of their value, use {{para|checkblanks|no}}. This works with both the &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; functions.&lt;br /&gt;
&lt;br /&gt;
'''Examples'''&lt;br /&gt;
&lt;br /&gt;
If the code &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:ParameterCount|all|checkblanks=no}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; was added to the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{my example template}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; template, the code &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{my example template|1|2|foo=bar|baz=}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; would make ParameterCount produce &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox | |&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Mr. Stradivarius</name></author>
	</entry>
</feed>