<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.fifthempire.info/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=199.168.113.216</id>
	<title>Fifth Empire Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.fifthempire.info/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=199.168.113.216"/>
	<link rel="alternate" type="text/html" href="https://wiki.fifthempire.info/index.php/Special:Contributions/199.168.113.216"/>
	<updated>2026-06-23T01:28:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://wiki.fifthempire.info/index.php?title=Module:Yesno/doc&amp;diff=27890</id>
		<title>Module:Yesno/doc</title>
		<link rel="alternate" type="text/html" href="https://wiki.fifthempire.info/index.php?title=Module:Yesno/doc&amp;diff=27890"/>
		<updated>2015-07-29T14:34:20Z</updated>

		<summary type="html">&lt;p&gt;199.168.113.216: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{High-risk|11,600,000+}}&lt;br /&gt;
{{Module rating|protected}}&lt;br /&gt;
This module provides a consistent interface for processing boolean or boolean-style string input. 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;yes&amp;quot;, &amp;quot;no&amp;quot;, etc. This module processes these kinds of strings and turns them into boolean input for Lua to process. 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;. The module also accepts other Lua structures as input, i.e. booleans, numbers, tables, and functions. 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;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;yesno(value, default)&amp;lt;/source&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. 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;. Other values evaluate to &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
First, load the module. Note that it can only be loaded from other Lua modules, not from normal wiki pages. For normal wiki pages you can use {{tl|yesno}} instead.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local yesno = require(&#039;Module:Yesno&#039;)&lt;br /&gt;
&amp;lt;/source&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;. &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;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- These always return true:&lt;br /&gt;
yesno(&#039;yes&#039;)&lt;br /&gt;
yesno(&#039;y&#039;)&lt;br /&gt;
yesno(&#039;true&#039;)&lt;br /&gt;
yesno(&#039;t&#039;)&lt;br /&gt;
yesno(&#039;1&#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(&#039;no&#039;)&lt;br /&gt;
yesno(&#039;n&#039;)&lt;br /&gt;
yesno(&#039;false&#039;)&lt;br /&gt;
yesno(&#039;f&#039;)&lt;br /&gt;
yesno(&#039;0&#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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String values are converted to lower case before they are matched:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- These always return true:&lt;br /&gt;
yesno(&#039;Yes&#039;)&lt;br /&gt;
yesno(&#039;YES&#039;)&lt;br /&gt;
yesno(&#039;yEs&#039;)&lt;br /&gt;
yesno(&#039;Y&#039;)&lt;br /&gt;
yesno(&#039;tRuE&#039;)&lt;br /&gt;
&lt;br /&gt;
-- These always return false:&lt;br /&gt;
yesno(&#039;No&#039;)&lt;br /&gt;
yesno(&#039;NO&#039;)&lt;br /&gt;
yesno(&#039;nO&#039;)&lt;br /&gt;
yesno(&#039;N&#039;)&lt;br /&gt;
yesno(&#039;fALsE&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can specify a default value if yesno receives input other than that listed above. If you don&#039;t supply a default, the module &lt;br /&gt;
yesno({}, true)&lt;br /&gt;
yesno(5, true)&lt;br /&gt;
yesno(function() return &#039;This is a function.&#039; end, true)&lt;br /&gt;
&lt;br /&gt;
-- These return &amp;quot;bar&amp;quot;:&lt;br /&gt;
yesno(&#039;foo&#039;, &#039;bar&#039;)&lt;br /&gt;
yesno({}, &#039;bar&#039;)&lt;br /&gt;
yesno(5, &#039;bar&#039;)&lt;br /&gt;
yesno(function() return &#039;This is a function.&#039; end, &#039;bar&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the blank string also functions this way:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
yesno(&#039;&#039;)        -- Returns nil.&lt;br /&gt;
yesno(&#039;&#039;, true)  -- Returns true.&lt;br /&gt;
yesno(&#039;&#039;, &#039;bar&#039;) -- Returns &amp;quot;bar&amp;quot;.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although the blank string usually evaluates to false in wikitext, it evaluates to true in Lua. This module prefers the Lua behaviour over the wikitext behaviour. If&lt;/div&gt;</summary>
		<author><name>199.168.113.216</name></author>
	</entry>
</feed>