모듈:Yesno: 두 판 사이의 차이
보이기
잔글 판 1개를 가져왔습니다: 위키백과 등->자유위키에서 모듈 가져옴 |
편집 요약 없음 |
||
| 1번째 줄: | 1번째 줄: | ||
-- Function allowing for consistent treatment of boolean-like wikitext input. | -- Function allowing for consistent treatment of boolean-like wikitext input. | ||
-- It works similarly to the template {{yesno}}. | -- It works similarly to the template {{yesno}}. | ||
return function (val, default) | return function (val, default) | ||
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you | -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you | ||
| 14번째 줄: | 14번째 줄: | ||
or val == 'true' | or val == 'true' | ||
or val == 't' | or val == 't' | ||
or val == 'on' | |||
or val == '예' | or val == '예' | ||
or val == '참' | or val == '참' | ||
| 24번째 줄: | 25번째 줄: | ||
or val == 'false' | or val == 'false' | ||
or val == 'f' | or val == 'f' | ||
or val == 'off' | |||
or val == '아니오' | or val == '아니오' | ||
or val == '거짓' | or val == '거짓' | ||
2018년 3월 5일 (월) 15:36 판
{{#css: .template-documentation {
clear: both; margin: 1em 0 0 0; padding: 1em
} /* 아래 상자 */ .mbox-text {
clear: both; background-color: #e8ffe8;
}
.template-documentation-template-data .mw-templatedata-doc-desc {
display: none;
}
}}
위 설명은 모듈:Yesno/설명문서의 내용을 가져와 보여주고 있습니다.
연습장이나 사용자 문서에서 틀의 사용이나 수정을 연습할 수 있습니다.
-- 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 val == '예'
or val == '참'
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 val == '아니오'
or val == '거짓'
or tonumber(val) == 0
then
return false
else
return default
end
end