<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.mechsploit.me/index.php?action=history&amp;feed=atom&amp;title=Module%3AYesno%2Fdoc%2Fen</id>
	<title>Module:Yesno/doc/en - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mechsploit.me/index.php?action=history&amp;feed=atom&amp;title=Module%3AYesno%2Fdoc%2Fen"/>
	<link rel="alternate" type="text/html" href="https://wiki.mechsploit.me/index.php?title=Module:Yesno/doc/en&amp;action=history"/>
	<updated>2026-04-05T23:15:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.mechsploit.me/index.php?title=Module:Yesno/doc/en&amp;diff=3171&amp;oldid=prev</id>
		<title>MechsploWikiSysop: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.mechsploit.me/index.php?title=Module:Yesno/doc/en&amp;diff=3171&amp;oldid=prev"/>
		<updated>2025-09-04T07:24:43Z</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&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 03:24, 4 September 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&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;/table&gt;</summary>
		<author><name>MechsploWikiSysop</name></author>
	</entry>
	<entry>
		<id>https://wiki.mechsploit.me/index.php?title=Module:Yesno/doc/en&amp;diff=3170&amp;oldid=prev</id>
		<title>mw&gt;FuzzyBot: Updating to match new version of source page</title>
		<link rel="alternate" type="text/html" href="https://wiki.mechsploit.me/index.php?title=Module:Yesno/doc/en&amp;diff=3170&amp;oldid=prev"/>
		<updated>2021-08-17T21:31:50Z</updated>

		<summary type="html">&lt;p&gt;Updating to match new version of source page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#ifeq:{{SUBPAGENAME}}|doc||{{Documentation subpage}}}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;/noinclude&amp;gt;{{#switch:&lt;br /&gt;
| =&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Languages|Module:Yesno/doc}}&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --&amp;gt;&lt;br /&gt;
{{Shared Template Warning}}&lt;br /&gt;
{{high-risk}}&lt;br /&gt;
{{used in system}}&lt;br /&gt;
{{Module rating|release}}&lt;br /&gt;
{{Module rating|protected}}&lt;br /&gt;
This module provides a consistent interface for processing boolean or boolean-style string input.&lt;br /&gt;
While Lua allows the &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; boolean values, wikicode templates can only express boolean values through strings such as &amp;quot;1&amp;quot;, &amp;quot;0&amp;quot;, &amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;, etc.&lt;br /&gt;
This module processes these kinds of strings and turns them into boolean input for Lua to process.&lt;br /&gt;
It also returns &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; values as &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;, to allow for distinctions between &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
The module also accepts other Lua structures as input, i.e. booleans, numbers, tables, and functions.&lt;br /&gt;
If it is passed input that it does not recognise as boolean or &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;, it is possible to specify a default value to return.&lt;br /&gt;
== Module Quality ==&lt;br /&gt;
{{ModuleQuality}}&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
yesno(value, default)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is the value to be tested.&lt;br /&gt;
Boolean input or boolean-style input (see below) always evaluates to either &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; always evaluates to &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;.&lt;br /&gt;
Other values evaluate to &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Usage ==&lt;br /&gt;
First, load the module. Note that it can only be loaded from other Lua modules, not from normal wiki pages.&lt;br /&gt;
For normal wiki pages you can use {{tlx|yesno}} instead.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some input values always return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, and some always return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; values always return &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- These always return true:&lt;br /&gt;
yesno(&amp;#039;yes&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;y&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;true&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;t&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;1&amp;#039;)&lt;br /&gt;
yesno(1)&lt;br /&gt;
yesno(true)&lt;br /&gt;
&lt;br /&gt;
-- These always return false:&lt;br /&gt;
yesno(&amp;#039;no&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;n&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;false&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;f&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;0&amp;#039;)&lt;br /&gt;
yesno(0)&lt;br /&gt;
yesno(false)&lt;br /&gt;
&lt;br /&gt;
-- A nil value always returns nil:&lt;br /&gt;
yesno(nil)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
String values are converted to lower case before they are matched:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- These always return true:&lt;br /&gt;
yesno(&amp;#039;Yes&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;YES&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;yEs&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;Y&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;tRuE&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
-- These always return false:&lt;br /&gt;
yesno(&amp;#039;No&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;NO&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;nO&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;N&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;fALsE&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can specify a default value if &amp;lt;code&amp;gt;yesno&amp;lt;/code&amp;gt; receives input other than that listed above.&lt;br /&gt;
If you don&amp;#039;t supply a default, the module will return &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; for these inputs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- These return nil:&lt;br /&gt;
yesno(&amp;#039;foo&amp;#039;)&lt;br /&gt;
yesno({})&lt;br /&gt;
yesno(5)&lt;br /&gt;
yesno(function() return &amp;#039;This is a function.&amp;#039; end)&lt;br /&gt;
&lt;br /&gt;
-- These return true:&lt;br /&gt;
yesno(&amp;#039;foo&amp;#039;, true)&lt;br /&gt;
yesno({}, true)&lt;br /&gt;
yesno(5, true)&lt;br /&gt;
yesno(function() return &amp;#039;This is a function.&amp;#039; end, true)&lt;br /&gt;
&lt;br /&gt;
-- These return &amp;quot;bar&amp;quot;:&lt;br /&gt;
yesno(&amp;#039;foo&amp;#039;, &amp;#039;bar&amp;#039;)&lt;br /&gt;
yesno({}, &amp;#039;bar&amp;#039;)&lt;br /&gt;
yesno(5, &amp;#039;bar&amp;#039;)&lt;br /&gt;
yesno(function() return &amp;#039;This is a function.&amp;#039; end, &amp;#039;bar&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that the blank string also functions this way:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
yesno(&amp;#039;&amp;#039;)        -- Returns nil.&lt;br /&gt;
yesno(&amp;#039;&amp;#039;, true)  -- Returns true.&lt;br /&gt;
yesno(&amp;#039;&amp;#039;, &amp;#039;bar&amp;#039;) -- Returns &amp;quot;bar&amp;quot;.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although the blank string usually evaluates to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; in wikitext, it evaluates to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; in Lua.&lt;br /&gt;
This module prefers the Lua behaviour over the wikitext behaviour.&lt;br /&gt;
If treating the blank string as &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; is important for your module, you will need to remove blank arguments at an earlier stage of processing.&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:Modules]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Module documentation pages{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
| #default=&lt;br /&gt;
  {{#invoke:Template translation|renderTranslatedTemplate|template=Module:Yesno/doc|noshift=1|uselang={{int:lang}}}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>mw&gt;FuzzyBot</name></author>
	</entry>
</feed>