Jump to content

Template:Para

From p1gwars
Revision as of 21:17, 4 November 2025 by Rosie (talk | contribs) (Created page with "<onlyinclude><!-- -->{{{{{|safesubst:}}}#if:{{{plain|}}}|<templatestyles src="Template:Mono/styles.css"/>}}<!-- -->{{{{{|safesubst:}}}#if:{{yesno|{{{nowrap|1}}}}}|<templatestyles src="Template:Nowrap/styles.css"/>}}<!-- --><{{{{{|safesubst:}}}#if:{{{plain|}}}<!-- -->|span class="monospaced {{{{{|safesubst:}}}#if:{{{{{|safesubst:}}}yesno|{{{nowrap|1}}}}}|nowrap}}"<!-- -->|code {{{{{|safesubst:}}}#if:{{{{{|safesubst:}}}yesno|{{{nowrap|1}}}}}|class="nowrap"}}<!-- -->}}>&#...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

{{safesubst:#if:|<templatestyles src="Template:Mono/styles.css"/>}}{{safesubst:#if:-- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template "yesno".

return function (val, default) -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you -- should replace "val:lower()" with "mw.ustring.lower(val)" in the -- following line. val = type(val) == 'string' and val:lower() or val if val == nil then return nil elseif val == true or val == 'yes' or val == 'y' or val == 'true' or val == 't' or val == 'on' or tonumber(val) == 1 then return true elseif val == false or val == 'no' or val == 'n' or val == 'false' or val == 'f' or val == 'off' or tonumber(val) == 0 then return false else return default end end|<templatestyles src="Template:Nowrap/styles.css"/>}}<{{safesubst:#if:|span class="monospaced {{safesubst:#if:-- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template "yesno".

return function (val, default) -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you -- should replace "val:lower()" with "mw.ustring.lower(val)" in the -- following line. val = type(val) == 'string' and val:lower() or val if val == nil then return nil elseif val == true or val == 'yes' or val == 'y' or val == 'true' or val == 't' or val == 'on' or tonumber(val) == 1 then return true elseif val == false or val == 'no' or val == 'n' or val == 'false' or val == 'f' or val == 'off' or tonumber(val) == 0 then return false else return default end end|nowrap}}"|code {{safesubst:#if:-- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template "yesno".

return function (val, default) -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you -- should replace "val:lower()" with "mw.ustring.lower(val)" in the -- following line. val = type(val) == 'string' and val:lower() or val if val == nil then return nil elseif val == true or val == 'yes' or val == 'y' or val == 'true' or val == 't' or val == 'on' or tonumber(val) == 1 then return true elseif val == false or val == 'no' or val == 'n' or val == 'false' or val == 'f' or val == 'off' or tonumber(val) == 0 then return false else return default end end|class="nowrap"}}}}>|{{safesubst:#if:1|{{{1}}}=}}</{{safesubst:#if:|span|code}}> Template:Documentation