Template:Yesno/doc/cs

From mediawiki.org

Tato šablona normalizuje vstup tak, aby bylo výstupem ano/ne.

Použití[edit]

Šablona má pět možných výstupů v závislosti na výchozím parametru (pokud chcete).

Při nejjednodušším použití to budou všechny buď "yes" nebo "" (prázdné = nic, žádné znaky).

  • {{Yesno|yes}} → "yes" (platí také pro "Yes", "YeS", etc, "Y", "y" a "1")
  • {{Yesno|no}} → "" platí také pro "No", "NO", "nO", "N", "n" a "0")
  • {{Yesno}} → ""
  • {{Yesno|¬}} → ""
  • {{Yesno|purplemonkeydishwasher}} → "yes" (platí také pro jakoukoli jinou hodnotu, která není uvedena výše)

Každý z nich může být přepsán.

  • {{Yesno|yes|yes=bacon}} → "bacon" (platí také pro "Yes", "YeS", etc, "Y", "y" a "1")
  • {{Yesno|no|no=ham}} → "ham" (platí také pro to "No", "NO", "nO", "N", "n" a "0")
  • {{Yesno|blank=eggs}} → "eggs"
    • but {{Yesno|no=ham}} → "ham"
    • and {{Yesno|blank=eggs|no=ham}} → "eggs"
  • {{Yesno|¬|¬=sausage|blank=eggs|no=ham}} → "sausage"
    • and {{Yesno|¬=sausage|blank=eggs|no=ham}} → "sausage"
  • {{Yesno|purplemonkeydishwasher|def=cup-of-tea}} → "{{Yesno|purplemonkeydishwasher|def=cup-of-tea}}" (platí také pro jakoukoli jinou hodnotu, která není uvedena výše)
    • but {{Yesno|purplemonkeydishwasher|yes=bacon}} → "bacon"
    • and {{Yesno|purplemonkeydishwasher|def=cup-of-tea|yes=bacon}} → "cup-of-tea"

Toto lze použít (zřejmě zvráceně).:

  • {{Yesno|yes|yes=no|no=yes}} → "no"
  • {{Yesno|no|yes=no|no=yes}} → "yes"

Vznikne tak logická inverze.

TemplateData[edit]

Tato sekce obsahuje strukturovaný popis parametrů šablony využívající rozšíření TemplateData, který umožňuje snadnější používání této šablony v prostředí VisualEditoru.

Yesno/doc

This template normalises an input to be a yes or nil output.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Input value1

The value to be evaluated.

Stringrequired
Output on yesyes

Specifies the output of the template when the input value is a case-insensitive forms of 'Yes', 'Y', 'True' or '1'.

Stringoptional
Output on nono

Specifies the output of the template when the input value is a case-insensitive forms of 'No', 'N', 'False', or '0'.

Stringoptional
Output on blank inputblank

Specifies the output of the template when the input value is defined but is either empty or contains nothing but whitespace character(s).

Stringoptional
Output on ¬¬

Specifies the output of the template when the input value is either '¬' or entirely missing (undefined).

Stringoptional
Definite outputdef

Specifies the output of the template when the input value is defined but not a form of 'yes', 'no', '1', '0', '¬' or blank.

Stringoptional

Související odkazy[edit]