Дополнительные действия
(Новая страница: «{{docpage}} {{СИШ}} Шаблон предназначен для унифицированной обработки параметров, которые могут принимать значения «истина» и «ложь». Он не предназначен для использования в статьях напрямую, но для других шаблонов. == Использование== Шаблон...») |
Нет описания правки |
||
(не показана 1 промежуточная версия этого же участника) | |||
Строка 1: | Строка 1: | ||
{{ | {{Documentation}} | ||
This template normalises an input to be a yes/no output. | |||
== | === Usage === | ||
The template has five possible outputs depending on the default parameter (input if you will). | |||
In its simplest usage these will all be either "yes" or "" (blank - nothing no characters). | |||
{ | # <tt><nowiki>{{yesno|yes}}</nowiki></tt> result "yes" (also applies to "Yes", "YeS", etc, "Y", "y" and "1") | ||
# <tt><nowiki>{{yesno|no}}</nowiki></tt> result "" (also applies to "No", "NO", "nO", "N", "n" and "0") | |||
# <tt><nowiki>{{yesno}}</nowiki></tt> result "" | |||
# <tt><nowiki>{{yesno|¬}}</nowiki></tt> result "" | |||
# <tt><nowiki>{{yesno|purplemonkeydishwasher}}</nowiki></tt> result "yes" (also applies to any other value not given above). | |||
== | Each of these can be over-ridden. | ||
* {{ | # <tt><nowiki>{{yesno|yes|yes=bacon}}</nowiki></tt> result "bacon" (also applies to "Yes", "YeS", etc, "Y", "y" and "1") | ||
# <tt><nowiki>{{yesno|no|no=ham}}</nowiki></tt> result "ham" (also applies to "No", "NO", "nO", "N", "n" and "0") | |||
# <tt><nowiki>{{yesno|blank= eggs}}</nowiki></tt> result "eggs" | |||
## but <tt><nowiki>{{yesno|no=ham}}</nowiki></tt> result "ham" | |||
## and <tt><nowiki>{{yesno|blank= eggs|no=ham}}</nowiki></tt> result "eggs" | |||
# <tt><nowiki>{{yesno|¬|¬=sausage}}</nowiki></tt> result "sausage" | |||
# <tt><nowiki>{{yesno|purplemonkeydishwasher|def=cup-of-tea}}</nowiki></tt> result "cup-of-tea" (also applies to any other value not given above). | |||
## but <tt><nowiki>{{yesno|purplemonkeydishwasher|yes=bacon}}</nowiki></tt> result "bacon" | |||
## but <tt><nowiki>{{yesno|purplemonkeydishwasher|def=cup-of-tea|yes=bacon}}</nowiki></tt> result "cup-of-tea" | |||
This may be used (apparently perversely) thus: | |||
* <tt><nowiki>{{yesno|yes|yes=no|no=yes}}</nowiki></tt> result "no" | |||
* <tt><nowiki>{{yesno|no|yes=no|no=yes}}</nowiki></tt> result "yes" | |||
This creates a logical inversion. | |||
<includeonly> | <includeonly> | ||
[[ | [[Category:Шаблоны]] | ||
</includeonly> | </includeonly> | ||
<noinclude></noinclude> |
Текущая версия от 09:10, 24 октября 2023
message_subpage_title
message_subpage_desc
This template normalises an input to be a yes/no output.
Usage
The template has five possible outputs depending on the default parameter (input if you will).
In its simplest usage these will all be either "yes" or "" (blank - nothing no characters).
- {{yesno|yes}} result "yes" (also applies to "Yes", "YeS", etc, "Y", "y" and "1")
- {{yesno|no}} result "" (also applies to "No", "NO", "nO", "N", "n" and "0")
- {{yesno}} result ""
- {{yesno|¬}} result ""
- {{yesno|purplemonkeydishwasher}} result "yes" (also applies to any other value not given above).
Each of these can be over-ridden.
- {{yesno|yes|yes=bacon}} result "bacon" (also applies to "Yes", "YeS", etc, "Y", "y" and "1")
- {{yesno|no|no=ham}} result "ham" (also applies to "No", "NO", "nO", "N", "n" and "0")
- {{yesno|blank= eggs}} result "eggs"
- but {{yesno|no=ham}} result "ham"
- and {{yesno|blank= eggs|no=ham}} result "eggs"
- {{yesno|¬|¬=sausage}} result "sausage"
- {{yesno|purplemonkeydishwasher|def=cup-of-tea}} result "cup-of-tea" (also applies to any other value not given above).
- but {{yesno|purplemonkeydishwasher|yes=bacon}} result "bacon"
- but {{yesno|purplemonkeydishwasher|def=cup-of-tea|yes=bacon}} result "cup-of-tea"
This may be used (apparently perversely) thus:
- {{yesno|yes|yes=no|no=yes}} result "no"
- {{yesno|no|yes=no|no=yes}} result "yes"
This creates a logical inversion.