Module:Yesno/doc
This is the documentation page for Module:Yesno
Lua error in Module:Effective_protection_level at line 64: attempt to index field 'TitleBlacklist' (a nil value).
| File:Green check.svg | This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. |
Lua error in Module:Effective_protection_level at line 64: attempt to index field 'TitleBlacklist' (a nil value).
-->
This module provides a consistent interface for processing boolean or boolean-style string input. While Lua allows the true and false boolean values, wikicode templates can only express boolean values through strings such as "yes", "no", etc. This module processes these kinds of strings and turns them into boolean input for Lua to process. It also returns nil values as nil, to allow for distinctions between nil and false. 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 nil, it is possible to specify a default value to return.
Syntax
<syntaxhighlight lang="lua">yesno(value, default)</syntaxhighlight>
value is the value to be tested. Boolean input or boolean-style input (see below) always evaluates to either true or false, and nil always evaluates to nil. Other values evaluate to default.
Usage
OPEN PRIVATE