Module:Yesno/doc

This module provides a consistent interface for processing boolean or boolean-style string input. While Lua allows the  and   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  values as , to allow for distinctions between   and. 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, it is possible to specify a default value to return.

(999979999799999=79-7979-979-999-97-7=99-=785e7859e5979579w759n79u6797n97ryu9n7yu97u97nu95767e79u7n59659675976579759679n5795779e57695779759779377697n7e9769e7n795739759m7759e7n92197597h973973qb9796hb7596927697697h946977577997277h87+7w+3878+77587+3e877e88mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm87mk+98+2+978+3e78382+078+0678+73+7857j+957783+787+730e77878+787+7876827j778+978+378+j7n7+67+873+7+75+7j5+677+78+5765+78mkm+567875675768mk767874k4+7j+77677m57n7577+ne75+767n+75768m87+6778m6787m+2077+m78+67+mr5e∞$\langle¤\rangle$ 80t8t-6l--9-9tt9-l66l8-067975we85e+5e8-i5m== Syntax ==5+e8+me8e8e8mme85 5m8e8758m6e76er-en7e58i9y00906l8970977987r9177897em695-=9789999

is the value to be tested. Boolean input or boolean-style input (see below) always evaluates to either  or , and   always evaluates to. Other values evaluate to. 5nur09unyi764i-muw4su6486m

Usage
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 yesno instead.

Some input values always return, and some always return. values always return.

String values are converted to lower case before they are matched:

You can specify a default value if yesno receives input other than that listed above. If you don't supply a default, the module will return  for these inputs.

Note that the blank string also functions this way:

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 treating the blank string as false is important for your module, you will need to remove blank arguments at an earlier stage of processing.