CINXE.COM
Module:Yesno - 维基文库,自由的图书馆
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available" lang="zh" dir="ltr"> <head> <meta charset="UTF-8"> <title>Module:Yesno - 维基文库,自由的图书馆</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )zhwikisourcemwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat" :"zh","wgMonthNames":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgRequestId":"afe68b9b-03fc-47af-b828-4a56d8e46a2b","wgCanonicalNamespace":"Module","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":828,"wgPageName":"Module:Yesno","wgTitle":"Yesno","wgCurRevisionId":2488009,"wgRevisionId":2488009,"wgArticleId":182358,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["使用已弃用source标签的页面"],"wgPageViewLanguage":"zh","wgPageContentLanguage":"zh","wgPageContentModel":"Scribunto","wgRelevantPageName":"Module:Yesno","wgRelevantArticleId":182358,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikisource","wgCiteReferencePreviewsActive":true,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr", "pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":700,"prpProofreadPageBookNamespaces":[0],"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q15098140","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"wgSiteNoticeId":"2.0"};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.pygments":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready", "ext.uls.interlanguage":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready","ext.dismissableSiteNotice.styles":"ready"};RLPAGEMODULES=["ext.pygments.view","site","mediawiki.page.ready","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.noteTA","ext.gadget.tabbedwindow","ext.gadget.PageNumbers","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","wikibase.client.vector-2022","ext.checkUser.clientHints","wikibase.sidebar.tracking","ext.dismissableSiteNotice"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=zh&modules=ext.dismissableSiteNotice.styles%7Cext.pygments%2CwikimediaBadges%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=zh&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=zh&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.5"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Module:Yesno - 维基文库,自由的图书馆"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//zh.m.wikisource.org/wiki/Module:Yesno"> <link rel="alternate" type="application/x-wiki" title="编辑" href="/w/index.php?title=Module:Yesno&action=edit"> <link rel="icon" href="/static/favicon/wikisource.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikisource (zh)"> <link rel="EditURI" type="application/rsd+xml" href="//zh.wikisource.org/w/api.php?action=rsd"> <link rel="canonical" href="https://zh.wikisource.org/wiki/Module:Yesno"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh"> <link rel="alternate" type="application/atom+xml" title="Wikisource的Atom feed" href="/w/index.php?title=Special:%E6%9C%80%E8%BF%91%E6%9B%B4%E6%94%B9&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-828 ns-subject mw-editable page-Module_Yesno rootpage-Module_Yesno skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">跳转到内容</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="站点"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="主菜单" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">主菜单</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">主菜单</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">移至侧栏</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">隐藏</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> 导航 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/Wikisource:%E9%A6%96%E9%A1%B5" title="访问首页[z]" accesskey="z"><span>首页</span></a></li><li id="n-randomwork" class="mw-list-item"><a href="/wiki/Special:%E9%9A%8F%E6%9C%BA%E6%A0%B9%E9%A1%B5%E9%9D%A2/Main"><span>随机作品</span></a></li><li id="n-randomauthor" class="mw-list-item"><a href="/wiki/Special:%E9%9A%8F%E6%9C%BA%E9%A1%B5%E9%9D%A2/Author"><span>随机作者</span></a></li><li id="n-randomindex" class="mw-list-item"><a href="/wiki/Special:%E9%9A%8F%E6%9C%BA%E6%A0%B9%E9%A1%B5%E9%9D%A2/Index"><span>随机原本</span></a></li><li id="n-allpages" class="mw-list-item"><a href="/wiki/Special:%E6%89%80%E6%9C%89%E9%A1%B5%E9%9D%A2"><span>所有页面</span></a></li> </ul> </div> </div> <div id="p-editor" class="vector-menu mw-portlet mw-portlet-editor" > <div class="vector-menu-heading"> 编者 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-portal" class="mw-list-item"><a href="/wiki/Wikisource:%E7%A4%BE%E5%8C%BA%E4%B8%BB%E9%A1%B5" title="关于本计划,您可做的事,何处找到您所需"><span>社群首页</span></a></li><li id="n-scriptorium" class="mw-list-item"><a href="/wiki/Wikisource:%E5%86%99%E5%AD%97%E9%97%B4"><span>写字间</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:%E6%9C%80%E8%BF%91%E6%9B%B4%E6%94%B9" title="本wiki的最近更改列表[r]" accesskey="r"><span>最近更改</span></a></li> </ul> </div> </div> <div id="p-help" class="vector-menu mw-portlet mw-portlet-help" > <div class="vector-menu-heading"> 帮助 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/Help:%E7%9B%AE%E5%BD%95" title="查找帮助的地方"><span>帮助</span></a></li><li id="n-about" class="mw-list-item"><a href="/wiki/Wikisource:%E5%85%B3%E4%BA%8E"><span>关于维基文库</span></a></li><li id="n-contact" class="mw-list-item"><a href="/wiki/Wikisource:%E8%81%94%E7%BB%9C%E6%88%91%E4%BB%AC"><span>联系我们</span></a></li><li id="n-policy" class="mw-list-item"><a href="/wiki/Wikisource:%E6%96%B9%E9%92%88%E4%B8%8E%E6%8C%87%E5%BC%95"><span>方针与指引</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/Wikisource:%E9%A6%96%E9%A1%B5" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikisource.svg" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Wikisource" src="/static/images/mobile/copyright/wikisource-wordmark-zh.svg" style="width: 7.125em; height: 1.5em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Special:%E6%90%9C%E7%B4%A2" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="搜索Wikisource内容[f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>搜索</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="搜索Wikisource内容" aria-label="搜索Wikisource内容" autocapitalize="sentences" title="搜索Wikisource内容[f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:搜索"> </div> <button class="cdx-button cdx-search-input__end-button">搜索</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="个人工具"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="外观"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="更改页面字体大小、宽度和颜色的外观" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="外观" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">外观</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_zh.wikisource.org&uselang=zh" class=""><span>资助</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:%E5%88%9B%E5%BB%BA%E8%B4%A6%E6%88%B7&returnto=Module%3AYesno" title="我们推荐您创建账号并登录,但这不是强制性的" class=""><span>创建账号</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:%E7%94%A8%E6%88%B7%E7%99%BB%E5%BD%95&returnto=Module%3AYesno" title="我们推荐您登录,但这不是强制性的[o]" accesskey="o" class=""><span>登录</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="更多选项" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="个人工具" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">个人工具</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="用户菜单" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_zh.wikisource.org&uselang=zh"><span>资助</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:%E5%88%9B%E5%BB%BA%E8%B4%A6%E6%88%B7&returnto=Module%3AYesno" title="我们推荐您创建账号并登录,但这不是强制性的"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>创建账号</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:%E7%94%A8%E6%88%B7%E7%99%BB%E5%BD%95&returnto=Module%3AYesno" title="我们推荐您登录,但这不是强制性的[o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>登录</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> 未登录编辑者的页面 <a href="/wiki/Help:%E6%96%B0%E6%89%8B%E5%85%A5%E9%97%A8" aria-label="了解有关编辑的更多信息"><span>了解详情</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Special:%E6%88%91%E7%9A%84%E8%B4%A1%E7%8C%AE" title="来自此IP地址的编辑列表[y]" accesskey="y"><span>贡献</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Special:%E6%88%91%E7%9A%84%E8%AE%A8%E8%AE%BA%E9%A1%B5" title="有关本IP地址编辑的讨论[n]" accesskey="n"><span>讨论</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><div id="mw-dismissablenotice-anonplace"></div><script>(function(){var node=document.getElementById("mw-dismissablenotice-anonplace");if(node){node.outerHTML="\u003Cdiv class=\"mw-dismissable-notice\"\u003E\u003Cdiv class=\"mw-dismissable-notice-close\"\u003E[\u003Ca tabindex=\"0\" role=\"button\"\u003E关闭\u003C/a\u003E]\u003C/div\u003E\u003Cdiv class=\"mw-dismissable-notice-body\"\u003E\u003C!-- CentralNotice --\u003E\u003Cdiv id=\"localNotice\" data-nosnippet=\"\"\u003E\u003Cdiv class=\"anonnotice\" lang=\"zh\" dir=\"ltr\"\u003E\u003Cp\u003E-\n\u003C/p\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E";}}());</script></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="站点"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="目录" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">目录</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">移至侧栏</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">隐藏</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">序言</div> </a> </li> <li id="toc-Syntax" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Syntax"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Syntax</span> </div> </a> <ul id="toc-Syntax-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Usage" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Usage"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Usage</span> </div> </a> <ul id="toc-Usage-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="目录" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="开关目录" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">开关目录</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-namespace">Module</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Yesno</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="前往另一种语言写成的文章。54种语言可用" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-54" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">54种语言</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-ar mw-list-item"><a href="https://ar.wikisource.org/wiki/%D9%88%D8%AD%D8%AF%D8%A9:Yesno" title="وحدة:Yesno – 阿拉伯语" lang="ar" hreflang="ar" data-title="وحدة:Yesno" data-language-autonym="العربية" data-language-local-name="阿拉伯语" class="interlanguage-link-target"><span>العربية</span></a></li><li class="interlanguage-link interwiki-as mw-list-item"><a href="https://as.wikisource.org/wiki/Module:Yesno" title="Module:Yesno – 阿萨姆语" lang="as" hreflang="as" data-title="Module:Yesno" data-language-autonym="অসমীয়া" data-language-local-name="阿萨姆语" class="interlanguage-link-target"><span>অসমীয়া</span></a></li><li class="interlanguage-link interwiki-az mw-list-item"><a href="https://az.wikisource.org/wiki/Modul:Yesno" title="Modul:Yesno – 阿塞拜疆语" lang="az" hreflang="az" data-title="Modul:Yesno" data-language-autonym="Azərbaycanca" data-language-local-name="阿塞拜疆语" class="interlanguage-link-target"><span>Azərbaycanca</span></a></li><li class="interlanguage-link interwiki-ban mw-list-item"><a href="https://ban.wikisource.org/wiki/Modul:Yesno" title="Modul:Yesno – 巴厘语" lang="ban" hreflang="ban" data-title="Modul:Yesno" data-language-autonym="Basa Bali" data-language-local-name="巴厘语" class="interlanguage-link-target"><span>Basa Bali</span></a></li><li class="interlanguage-link interwiki-bcl mw-list-item"><a href="https://bcl.wikisource.org/wiki/Module:Yesno" title="Module:Yesno – Central Bikol" lang="bcl" hreflang="bcl" data-title="Module:Yesno" data-language-autonym="Bikol Central" data-language-local-name="Central Bikol" class="interlanguage-link-target"><span>Bikol Central</span></a></li><li class="interlanguage-link interwiki-be mw-list-item"><a href="https://be.wikisource.org/wiki/%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:%D0%A2%D0%B0%D0%BA%D0%9D%D0%B5" title="Модуль:ТакНе – 白俄罗斯语" lang="be" hreflang="be" data-title="Модуль:ТакНе" data-language-autonym="Беларуская" data-language-local-name="白俄罗斯语" class="interlanguage-link-target"><span>Беларуская</span></a></li><li class="interlanguage-link interwiki-bg mw-list-item"><a href="https://bg.wikisource.org/wiki/%D0%9C%D0%BE%D0%B4%D1%83%D0%BB:Yesno" title="Модул:Yesno – 保加利亚语" lang="bg" hreflang="bg" data-title="Модул:Yesno" data-language-autonym="Български" data-language-local-name="保加利亚语" class="interlanguage-link-target"><span>Български</span></a></li><li class="interlanguage-link interwiki-bn mw-list-item"><a href="https://bn.wikisource.org/wiki/%E0%A6%AE%E0%A6%A1%E0%A6%BF%E0%A6%89%E0%A6%B2:Yesno" title="মডিউল:Yesno – 孟加拉语" lang="bn" hreflang="bn" data-title="মডিউল:Yesno" data-language-autonym="বাংলা" data-language-local-name="孟加拉语" class="interlanguage-link-target"><span>বাংলা</span></a></li><li class="interlanguage-link interwiki-bs mw-list-item"><a href="https://bs.wikisource.org/wiki/Modul:Yesno" title="Modul:Yesno – 波斯尼亚语" lang="bs" hreflang="bs" data-title="Modul:Yesno" data-language-autonym="Bosanski" data-language-local-name="波斯尼亚语" class="interlanguage-link-target"><span>Bosanski</span></a></li><li class="interlanguage-link interwiki-ca mw-list-item"><a href="https://ca.wikisource.org/wiki/M%C3%B2dul:Yesno" title="Mòdul:Yesno – 加泰罗尼亚语" lang="ca" hreflang="ca" data-title="Mòdul:Yesno" data-language-autonym="Català" data-language-local-name="加泰罗尼亚语" class="interlanguage-link-target"><span>Català</span></a></li><li class="interlanguage-link interwiki-cs mw-list-item"><a href="https://cs.wikisource.org/wiki/Modul:Yesno" title="Modul:Yesno – 捷克语" lang="cs" hreflang="cs" data-title="Modul:Yesno" data-language-autonym="Čeština" data-language-local-name="捷克语" class="interlanguage-link-target"><span>Čeština</span></a></li><li class="interlanguage-link interwiki-de mw-list-item"><a href="https://de.wikisource.org/wiki/Modul:Yesno" title="Modul:Yesno – 德语" lang="de" hreflang="de" data-title="Modul:Yesno" data-language-autonym="Deutsch" data-language-local-name="德语" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-el mw-list-item"><a href="https://el.wikisource.org/wiki/Module:Yesno" title="Module:Yesno – 希腊语" lang="el" hreflang="el" data-title="Module:Yesno" data-language-autonym="Ελληνικά" data-language-local-name="希腊语" class="interlanguage-link-target"><span>Ελληνικά</span></a></li><li class="interlanguage-link interwiki-en mw-list-item"><a href="https://en.wikisource.org/wiki/Module:Yesno" title="Module:Yesno – 英语" lang="en" hreflang="en" data-title="Module:Yesno" data-language-autonym="English" data-language-local-name="英语" class="interlanguage-link-target"><span>English</span></a></li><li class="interlanguage-link interwiki-es mw-list-item"><a href="https://es.wikisource.org/wiki/M%C3%B3dulo:Yesno" title="Módulo:Yesno – 西班牙语" lang="es" hreflang="es" data-title="Módulo:Yesno" data-language-autonym="Español" data-language-local-name="西班牙语" class="interlanguage-link-target"><span>Español</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikisource.org/wiki/%D9%BE%D9%88%D8%AF%D9%85%D8%A7%D9%86:Yesno" title="پودمان:Yesno – 波斯语" lang="fa" hreflang="fa" data-title="پودمان:Yesno" data-language-autonym="فارسی" data-language-local-name="波斯语" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-gl mw-list-item"><a href="https://gl.wikisource.org/wiki/M%C3%B3dulo:Yesno" title="Módulo:Yesno – 加利西亚语" lang="gl" hreflang="gl" data-title="Módulo:Yesno" data-language-autonym="Galego" data-language-local-name="加利西亚语" class="interlanguage-link-target"><span>Galego</span></a></li><li class="interlanguage-link interwiki-gu mw-list-item"><a href="https://gu.wikisource.org/wiki/%E0%AA%B5%E0%AA%BF%E0%AA%AD%E0%AA%BE%E0%AA%97:Yesno" title="વિભાગ:Yesno – 古吉拉特语" lang="gu" hreflang="gu" data-title="વિભાગ:Yesno" data-language-autonym="ગુજરાતી" data-language-local-name="古吉拉特语" class="interlanguage-link-target"><span>ગુજરાતી</span></a></li><li class="interlanguage-link interwiki-he mw-list-item"><a href="https://he.wikisource.org/wiki/%D7%99%D7%97%D7%99%D7%93%D7%94:Yesno" title="יחידה:Yesno – 希伯来语" lang="he" hreflang="he" data-title="יחידה:Yesno" data-language-autonym="עברית" data-language-local-name="希伯来语" class="interlanguage-link-target"><span>עברית</span></a></li><li class="interlanguage-link interwiki-hi mw-list-item"><a href="https://hi.wikisource.org/wiki/%E0%A4%AE%E0%A5%89%E0%A4%A1%E0%A5%8D%E0%A4%AF%E0%A5%82%E0%A4%B2:Yesno" title="मॉड्यूल:Yesno – 印地语" lang="hi" hreflang="hi" data-title="मॉड्यूल:Yesno" data-language-autonym="हिन्दी" data-language-local-name="印地语" class="interlanguage-link-target"><span>हिन्दी</span></a></li><li class="interlanguage-link interwiki-hr mw-list-item"><a href="https://hr.wikisource.org/wiki/Modul:Yesno" title="Modul:Yesno – 克罗地亚语" lang="hr" hreflang="hr" data-title="Modul:Yesno" data-language-autonym="Hrvatski" data-language-local-name="克罗地亚语" class="interlanguage-link-target"><span>Hrvatski</span></a></li><li class="interlanguage-link interwiki-hu mw-list-item"><a href="https://hu.wikisource.org/wiki/Modul:Yesno" title="Modul:Yesno – 匈牙利语" lang="hu" hreflang="hu" data-title="Modul:Yesno" data-language-autonym="Magyar" data-language-local-name="匈牙利语" class="interlanguage-link-target"><span>Magyar</span></a></li><li class="interlanguage-link interwiki-hy mw-list-item"><a href="https://hy.wikisource.org/wiki/%D5%84%D5%B8%D5%A4%D5%B8%D6%82%D5%AC:Yesno" title="Մոդուլ:Yesno – 亚美尼亚语" lang="hy" hreflang="hy" data-title="Մոդուլ:Yesno" data-language-autonym="Հայերեն" data-language-local-name="亚美尼亚语" class="interlanguage-link-target"><span>Հայերեն</span></a></li><li class="interlanguage-link interwiki-id mw-list-item"><a href="https://id.wikisource.org/wiki/Modul:Yesno" title="Modul:Yesno – 印度尼西亚语" lang="id" hreflang="id" data-title="Modul:Yesno" data-language-autonym="Bahasa Indonesia" data-language-local-name="印度尼西亚语" class="interlanguage-link-target"><span>Bahasa Indonesia</span></a></li><li class="interlanguage-link interwiki-is mw-list-item"><a href="https://is.wikisource.org/wiki/Module:Yesno" title="Module:Yesno – 冰岛语" lang="is" hreflang="is" data-title="Module:Yesno" data-language-autonym="Íslenska" data-language-local-name="冰岛语" class="interlanguage-link-target"><span>Íslenska</span></a></li><li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://ja.wikisource.org/wiki/%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Yesno" title="モジュール:Yesno – 日语" lang="ja" hreflang="ja" data-title="モジュール:Yesno" data-language-autonym="日本語" data-language-local-name="日语" class="interlanguage-link-target"><span>日本語</span></a></li><li class="interlanguage-link interwiki-jv mw-list-item"><a href="https://jv.wikisource.org/wiki/Modhul:Yesno" title="Modhul:Yesno – 爪哇语" lang="jv" hreflang="jv" data-title="Modhul:Yesno" data-language-autonym="Jawa" data-language-local-name="爪哇语" class="interlanguage-link-target"><span>Jawa</span></a></li><li class="interlanguage-link interwiki-kn mw-list-item"><a href="https://kn.wikisource.org/wiki/%E0%B2%AE%E0%B2%BE%E0%B2%A1%E0%B3%8D%E0%B2%AF%E0%B3%82%E0%B2%B2%E0%B3%8D:Yesno" title="ಮಾಡ್ಯೂಲ್:Yesno – 卡纳达语" lang="kn" hreflang="kn" data-title="ಮಾಡ್ಯೂಲ್:Yesno" data-language-autonym="ಕನ್ನಡ" data-language-local-name="卡纳达语" class="interlanguage-link-target"><span>ಕನ್ನಡ</span></a></li><li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://ko.wikisource.org/wiki/%EB%AA%A8%EB%93%88:Yesno" title="모듈:Yesno – 韩语" lang="ko" hreflang="ko" data-title="모듈:Yesno" data-language-autonym="한국어" data-language-local-name="韩语" class="interlanguage-link-target"><span>한국어</span></a></li><li class="interlanguage-link interwiki-la mw-list-item"><a href="https://la.wikisource.org/wiki/Modulus:Yesno" title="Modulus:Yesno – 拉丁语" lang="la" hreflang="la" data-title="Modulus:Yesno" data-language-autonym="Latina" data-language-local-name="拉丁语" class="interlanguage-link-target"><span>Latina</span></a></li><li class="interlanguage-link interwiki-lij mw-list-item"><a href="https://lij.wikisource.org/wiki/Modulo:Yesno" title="Modulo:Yesno – 利古里亚语" lang="lij" hreflang="lij" data-title="Modulo:Yesno" data-language-autonym="Ligure" data-language-local-name="利古里亚语" class="interlanguage-link-target"><span>Ligure</span></a></li><li class="interlanguage-link interwiki-lt mw-list-item"><a href="https://lt.wikisource.org/wiki/Module:Yesno" title="Module:Yesno – 立陶宛语" lang="lt" hreflang="lt" data-title="Module:Yesno" data-language-autonym="Lietuvių" data-language-local-name="立陶宛语" class="interlanguage-link-target"><span>Lietuvių</span></a></li><li class="interlanguage-link interwiki-mk mw-list-item"><a href="https://mk.wikisource.org/wiki/%D0%9C%D0%BE%D0%B4%D1%83%D0%BB:Yesno" title="Модул:Yesno – 马其顿语" lang="mk" hreflang="mk" data-title="Модул:Yesno" data-language-autonym="Македонски" data-language-local-name="马其顿语" class="interlanguage-link-target"><span>Македонски</span></a></li><li class="interlanguage-link interwiki-ml mw-list-item"><a href="https://ml.wikisource.org/wiki/%E0%B4%98%E0%B4%9F%E0%B4%95%E0%B4%82:Yesno" title="ഘടകം:Yesno – 马拉雅拉姆语" lang="ml" hreflang="ml" data-title="ഘടകം:Yesno" data-language-autonym="മലയാളം" data-language-local-name="马拉雅拉姆语" class="interlanguage-link-target"><span>മലയാളം</span></a></li><li class="interlanguage-link interwiki-mr mw-list-item"><a href="https://mr.wikisource.org/wiki/%E0%A4%B5%E0%A4%BF%E0%A4%AD%E0%A4%BE%E0%A4%97:Yesno" title="विभाग:Yesno – 马拉地语" lang="mr" hreflang="mr" data-title="विभाग:Yesno" data-language-autonym="मराठी" data-language-local-name="马拉地语" class="interlanguage-link-target"><span>मराठी</span></a></li><li class="interlanguage-link interwiki-ms mw-list-item"><a href="https://ms.wikisource.org/wiki/Modul:Yesno" title="Modul:Yesno – 马来语" lang="ms" hreflang="ms" data-title="Modul:Yesno" data-language-autonym="Bahasa Melayu" data-language-local-name="马来语" class="interlanguage-link-target"><span>Bahasa Melayu</span></a></li><li class="interlanguage-link interwiki-my mw-list-item"><a href="https://my.wikisource.org/wiki/%E1%80%99%E1%80%B1%E1%80%AC%E1%80%BA%E1%80%82%E1%80%BB%E1%80%B0%E1%80%B8:Yesno" title="မော်ဂျူး:Yesno – 缅甸语" lang="my" hreflang="my" data-title="မော်ဂျူး:Yesno" data-language-autonym="မြန်မာဘာသာ" data-language-local-name="缅甸语" class="interlanguage-link-target"><span>မြန်မာဘာသာ</span></a></li><li class="interlanguage-link interwiki-nap mw-list-item"><a href="https://nap.wikisource.org/wiki/Modulo:Yesno" title="Modulo:Yesno – 那不勒斯语" lang="nap" hreflang="nap" data-title="Modulo:Yesno" data-language-autonym="Napulitano" data-language-local-name="那不勒斯语" class="interlanguage-link-target"><span>Napulitano</span></a></li><li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://nl.wikisource.org/wiki/Module:Yesno" title="Module:Yesno – 荷兰语" lang="nl" hreflang="nl" data-title="Module:Yesno" data-language-autonym="Nederlands" data-language-local-name="荷兰语" class="interlanguage-link-target"><span>Nederlands</span></a></li><li class="interlanguage-link interwiki-no mw-list-item"><a href="https://no.wikisource.org/wiki/Modul:Yesno" title="Modul:Yesno – 挪威语" lang="no" hreflang="no" data-title="Modul:Yesno" data-language-autonym="Norsk" data-language-local-name="挪威语" class="interlanguage-link-target"><span>Norsk</span></a></li><li class="interlanguage-link interwiki-or mw-list-item"><a href="https://or.wikisource.org/wiki/%E0%AC%AE%E0%AC%A1%E0%AD%8D%E0%AD%9F%E0%AD%81%E0%AC%B2:Yesno" title="ମଡ୍ୟୁଲ:Yesno – 奥里亚语" lang="or" hreflang="or" data-title="ମଡ୍ୟୁଲ:Yesno" data-language-autonym="ଓଡ଼ିଆ" data-language-local-name="奥里亚语" class="interlanguage-link-target"><span>ଓଡ଼ିଆ</span></a></li><li class="interlanguage-link interwiki-pa mw-list-item"><a href="https://pa.wikisource.org/wiki/%E0%A8%AE%E0%A9%8C%E0%A8%A1%E0%A8%BF%E0%A8%8A%E0%A8%B2:Yesno" title="ਮੌਡਿਊਲ:Yesno – 旁遮普语" lang="pa" hreflang="pa" data-title="ਮੌਡਿਊਲ:Yesno" data-language-autonym="ਪੰਜਾਬੀ" data-language-local-name="旁遮普语" class="interlanguage-link-target"><span>ਪੰਜਾਬੀ</span></a></li><li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://pt.wikisource.org/wiki/M%C3%B3dulo:Yesno" title="Módulo:Yesno – 葡萄牙语" lang="pt" hreflang="pt" data-title="Módulo:Yesno" data-language-autonym="Português" data-language-local-name="葡萄牙语" class="interlanguage-link-target"><span>Português</span></a></li><li class="interlanguage-link interwiki-ro mw-list-item"><a href="https://ro.wikisource.org/wiki/Modul:Yesno" title="Modul:Yesno – 罗马尼亚语" lang="ro" hreflang="ro" data-title="Modul:Yesno" data-language-autonym="Română" data-language-local-name="罗马尼亚语" class="interlanguage-link-target"><span>Română</span></a></li><li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://ru.wikisource.org/wiki/%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Yesno" title="Модуль:Yesno – 俄语" lang="ru" hreflang="ru" data-title="Модуль:Yesno" data-language-autonym="Русский" data-language-local-name="俄语" class="interlanguage-link-target"><span>Русский</span></a></li><li class="interlanguage-link interwiki-sa mw-list-item"><a href="https://sa.wikisource.org/wiki/%E0%A4%AA%E0%A4%9F%E0%A4%B2%E0%A4%AE%E0%A5%8D:Yesno" title="पटलम्:Yesno – 梵语" lang="sa" hreflang="sa" data-title="पटलम्:Yesno" data-language-autonym="संस्कृतम्" data-language-local-name="梵语" class="interlanguage-link-target"><span>संस्कृतम्</span></a></li><li class="interlanguage-link interwiki-sr mw-list-item"><a href="https://sr.wikisource.org/wiki/%D0%9C%D0%BE%D0%B4%D1%83%D0%BB:Yesno" title="Модул:Yesno – 塞尔维亚语" lang="sr" hreflang="sr" data-title="Модул:Yesno" data-language-autonym="Српски / srpski" data-language-local-name="塞尔维亚语" class="interlanguage-link-target"><span>Српски / srpski</span></a></li><li class="interlanguage-link interwiki-su mw-list-item"><a href="https://su.wikisource.org/wiki/Modul:Yesno" title="Modul:Yesno – 巽他语" lang="su" hreflang="su" data-title="Modul:Yesno" data-language-autonym="Sunda" data-language-local-name="巽他语" class="interlanguage-link-target"><span>Sunda</span></a></li><li class="interlanguage-link interwiki-ta mw-list-item"><a href="https://ta.wikisource.org/wiki/Module:Yesno" title="Module:Yesno – 泰米尔语" lang="ta" hreflang="ta" data-title="Module:Yesno" data-language-autonym="தமிழ்" data-language-local-name="泰米尔语" class="interlanguage-link-target"><span>தமிழ்</span></a></li><li class="interlanguage-link interwiki-te mw-list-item"><a href="https://te.wikisource.org/wiki/%E0%B0%AE%E0%B0%BE%E0%B0%A1%E0%B1%8D%E0%B0%AF%E0%B1%82%E0%B0%B2%E0%B1%8D:Yesno" title="మాడ్యూల్:Yesno – 泰卢固语" lang="te" hreflang="te" data-title="మాడ్యూల్:Yesno" data-language-autonym="తెలుగు" data-language-local-name="泰卢固语" class="interlanguage-link-target"><span>తెలుగు</span></a></li><li class="interlanguage-link interwiki-th mw-list-item"><a href="https://th.wikisource.org/wiki/%E0%B8%A1%E0%B8%AD%E0%B8%94%E0%B8%B9%E0%B8%A5:Yesno" title="มอดูล:Yesno – 泰语" lang="th" hreflang="th" data-title="มอดูล:Yesno" data-language-autonym="ไทย" data-language-local-name="泰语" class="interlanguage-link-target"><span>ไทย</span></a></li><li class="interlanguage-link interwiki-tr mw-list-item"><a href="https://tr.wikisource.org/wiki/Mod%C3%BCl:Yesno" title="Modül:Yesno – 土耳其语" lang="tr" hreflang="tr" data-title="Modül:Yesno" data-language-autonym="Türkçe" data-language-local-name="土耳其语" class="interlanguage-link-target"><span>Türkçe</span></a></li><li class="interlanguage-link interwiki-uk mw-list-item"><a href="https://uk.wikisource.org/wiki/%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Yesno" title="Модуль:Yesno – 乌克兰语" lang="uk" hreflang="uk" data-title="Модуль:Yesno" data-language-autonym="Українська" data-language-local-name="乌克兰语" class="interlanguage-link-target"><span>Українська</span></a></li><li class="interlanguage-link interwiki-vi mw-list-item"><a href="https://vi.wikisource.org/wiki/M%C3%B4_%C4%91un:Yesno" title="Mô đun:Yesno – 越南语" lang="vi" hreflang="vi" data-title="Mô đun:Yesno" data-language-autonym="Tiếng Việt" data-language-local-name="越南语" class="interlanguage-link-target"><span>Tiếng Việt</span></a></li> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q15098140#sitelinks-wikisource" title="编辑跨语言链接" class="wbc-editpage">编辑链接</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="命名空间"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-module" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Module:Yesno" title="查看模块页面[c]" accesskey="c"><span>模块</span></a></li><li id="ca-talk" class="new vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Module_talk:Yesno&action=edit&redlink=1" rel="discussion" class="new" title="有关内容页面的讨论(页面不存在)[t]" accesskey="t"><span>讨论</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="更改语言变体" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="查看"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Module:Yesno"><span>阅读</span></a></li><li id="ca-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Module:Yesno&action=edit" title="编辑该页面[e]" accesskey="e"><span>编辑</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Module:Yesno&action=history" title="该页面过去的修订[h]" accesskey="h"><span>查看历史</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="页面工具"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="工具" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">工具</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">工具</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">移至侧栏</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">隐藏</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="更多选项" > <div class="vector-menu-heading"> 操作 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Module:Yesno"><span>阅读</span></a></li><li id="ca-more-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Module:Yesno&action=edit" title="编辑该页面[e]" accesskey="e"><span>编辑</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Module:Yesno&action=history"><span>查看历史</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> 常规 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:%E9%93%BE%E5%85%A5%E9%A1%B5%E9%9D%A2/Module:Yesno" title="所有链接至本页面的wiki页面列表[j]" accesskey="j"><span>链入页面</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:%E9%93%BE%E5%87%BA%E6%9B%B4%E6%94%B9/Module:Yesno" rel="nofollow" title="链自本页的页面的最近更改[k]" accesskey="k"><span>相关更改</span></a></li><li id="t-upload" class="mw-list-item"><a href="//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=zh" title="上传文件[u]" accesskey="u"><span>上传文件</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:%E7%89%B9%E6%AE%8A%E9%A1%B5%E9%9D%A2" title="所有特殊页面的列表[q]" accesskey="q"><span>特殊页面</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Module:Yesno&oldid=2488009" title="此页面该修订版本的固定链接"><span>固定链接</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Module:Yesno&action=info" title="关于此页面的更多信息"><span>页面信息</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:URL%E7%BC%A9%E7%9F%AD%E7%A8%8B%E5%BA%8F&url=https%3A%2F%2Fzh.wikisource.org%2Fwiki%2FModule%3AYesno"><span>获取短链接</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&url=https%3A%2F%2Fzh.wikisource.org%2Fwiki%2FModule%3AYesno"><span>下载二维码</span></a></li> </ul> </div> </div> <div id="p-electronpdfservice-sidebar-portlet-heading" class="vector-menu mw-portlet mw-portlet-electronpdfservice-sidebar-portlet-heading" > <div class="vector-menu-heading"> 打印/导出 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="electron-print_pdf" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&page=Module%3AYesno&action=show-download-screen"><span>下载为PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="javascript:print();" rel="alternate" title="本页面的可打印版本[p]" accesskey="p"><span>打印版本</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> 在其他项目中 </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="wb-otherproject-link wb-otherproject-commons mw-list-item"><a href="https://commons.wikimedia.org/wiki/Module:Yesno" hreflang="en"><span>维基共享资源</span></a></li><li class="wb-otherproject-link wb-otherproject-foundation mw-list-item"><a href="https://foundation.wikimedia.org/wiki/Module:Yesno" hreflang="en"><span>维基媒体基金会</span></a></li><li class="wb-otherproject-link wb-otherproject-mediawiki mw-list-item"><a href="https://www.mediawiki.org/wiki/Module:Yesno" hreflang="en"><span>MediaWiki</span></a></li><li class="wb-otherproject-link wb-otherproject-meta mw-list-item"><a href="https://meta.wikimedia.org/wiki/Module:Yesno" hreflang="en"><span>元维基</span></a></li><li class="wb-otherproject-link wb-otherproject-outreach mw-list-item"><a href="https://outreach.wikimedia.org/wiki/Module:Yesno" hreflang="en"><span>維基媒體拓展</span></a></li><li class="wb-otherproject-link wb-otherproject-sources mw-list-item"><a href="https://wikisource.org/wiki/Module:Yesno" hreflang="en"><span>多语言维基文库</span></a></li><li class="wb-otherproject-link wb-otherproject-species mw-list-item"><a href="https://species.wikimedia.org/wiki/Module:Yesno" hreflang="en"><span>维基物种</span></a></li><li class="wb-otherproject-link wb-otherproject-wikibooks mw-list-item"><a href="https://zh.wikibooks.org/wiki/Module:Yesno" hreflang="zh"><span>维基教科书</span></a></li><li class="wb-otherproject-link wb-otherproject-wikidata mw-list-item"><a href="https://www.wikidata.org/wiki/Module:Yesno" hreflang="en"><span>维基数据</span></a></li><li class="wb-otherproject-link wb-otherproject-wikifunctions mw-list-item"><a href="https://www.wikifunctions.org/wiki/Module:Yesno" hreflang="en"><span>Wikifunctions</span></a></li><li class="wb-otherproject-link wb-otherproject-wikimania mw-list-item"><a href="https://wikimania.wikimedia.org/wiki/Module:Yesno" hreflang="en"><span>维基媒体国际会议</span></a></li><li class="wb-otherproject-link wb-otherproject-wikinews mw-list-item"><a href="https://zh.wikinews.org/wiki/Module:Yesno" hreflang="zh"><span>维基新闻</span></a></li><li class="wb-otherproject-link wb-otherproject-wikipedia mw-list-item"><a href="https://zh.wikipedia.org/wiki/Module:Yesno" hreflang="zh"><span>维基百科</span></a></li><li class="wb-otherproject-link wb-otherproject-wikiquote mw-list-item"><a href="https://zh.wikiquote.org/wiki/Module:Yesno" hreflang="zh"><span>维基语录</span></a></li><li class="wb-otherproject-link wb-otherproject-wikiversity mw-list-item"><a href="https://zh.wikiversity.org/wiki/Module:Yesno" hreflang="zh"><span>维基学院</span></a></li><li class="wb-otherproject-link wb-otherproject-wikivoyage mw-list-item"><a href="https://zh.wikivoyage.org/wiki/Module:Yesno" hreflang="zh"><span>维基导游</span></a></li><li class="wb-otherproject-link wb-otherproject-wiktionary mw-list-item"><a href="https://zh.wiktionary.org/wiki/Module:Yesno" hreflang="zh"><span>维基词典</span></a></li><li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q15098140" title="链接到连接的数据仓库项目[g]" accesskey="g"><span>维基数据项目</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="页面工具"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="外观"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">外观</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">移至侧栏</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">隐藏</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> </div> <div id="siteSub" class="noprint">維基文庫,自由的圖書館</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="zh" dir="ltr"><style data-mw-deduplicate="TemplateStyles:r2443904">.mw-parser-output .template-documentation,.mw-parser-output #documentation-meta-data{clear:both;margin:1em 0 0 0;border:1px solid #a2a9b1;background-color:#ecfcf4;padding:5px}@media screen{html.skin-theme-clientpref-night .mw-parser-output .template-documentation,html.skin-theme-clientpref-night .mw-parser-output #documentation-meta-data{background-color:#0b1e1c}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .template-documentation,html.skin-theme-clientpref-os .mw-parser-output #documentation-meta-data{background-color:#0b1e1c}}</style> <div id="template-documentation" class="template-documentation iezoomfix"> <div style="padding-bottom:3px;border-bottom:1px solid #aaa;margin-bottom:1ex"> <span style="font-size:150%"><span typeof="mw:File"><span><img alt="文档图示" src="//upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png" decoding="async" width="50" height="22" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/75px-Test_Template_Info-Icon_-_Version_%282%29.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/100px-Test_Template_Info-Icon_-_Version_%282%29.svg.png 2x" data-file-width="1792" data-file-height="800" /></span></span> 模块文档</span><span class="mw-editsection-like plainlinks" id="doc_editlinks">[<a href="/wiki/Module:Yesno/doc" title="Module:Yesno/doc">查看</a>] [<a class="external text" href="https://zh.wikisource.org/w/index.php?title=Module:Yesno/doc&action=edit">编辑</a>] [<a class="external text" href="https://zh.wikisource.org/w/index.php?title=Module:Yesno/doc&action=history">历史</a>] [<a class="external text" href="https://zh.wikisource.org/w/index.php?title=Module:Yesno&action=purge">清除缓存</a>]</span></div> <p>This module provides a consistent interface for processing boolean or boolean-style string input. While Lua allows the <code>true</code> and <code>false</code> 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 <code>nil</code> values as <code>nil</code>, to allow for distinctions between <code>nil</code> and <code>false</code>. 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 <code>nil</code>, it is possible to specify a default value to return. </p> <div class="mw-heading mw-heading2"><h2 id="Syntax">Syntax</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Module:Yesno/doc&action=edit&section=T-1" title="编辑章节:Syntax"><span>编辑</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="n">yesno</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">default</span><span class="p">)</span> </pre></div> <p><code>value</code> is the value to be tested. Boolean input or boolean-style input (see below) always evaluates to either <code>true</code> or <code>false</code>, and <code>nil</code> always evaluates to <code>nil</code>. Other values evaluate to <code>default</code>. </p> <div class="mw-heading mw-heading2"><h2 id="Usage">Usage</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Module:Yesno/doc&action=edit&section=T-2" title="编辑章节:Usage"><span>编辑</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>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 {{<a href="/wiki/Template:Yesno" title="Template:Yesno">yesno</a>}} instead. </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">local</span> <span class="n">yesno</span> <span class="o">=</span> <span class="nb">require</span><span class="p">(</span><span class="s1">'Module:Yesno'</span><span class="p">)</span> </pre></div> <p>Some input values always return <code>true</code>, and some always return <code>false</code>. <code>nil</code> values always return <code>nil</code>. </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">-- 當參數是"yes"或其等效字串時將回傳"真":</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'yes'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'y'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'true'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'1'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="kc">true</span><span class="p">)</span> <span class="c1">-- 當參數是"no"或其等效字串時將回傳"假":</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'no'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'n'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'false'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'0'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="kc">false</span><span class="p">)</span> <span class="c1">-- 當參數是nil時將回傳nil:</span> <span class="n">yesno</span><span class="p">(</span><span class="kc">nil</span><span class="p">)</span> </pre></div> <p>第1個參數將忽視大小寫: </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">-- These always return true:</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'Yes'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'YES'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'yEs'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'Y'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'tRuE'</span><span class="p">)</span> <span class="c1">-- These always return false:</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'No'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'NO'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'nO'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'N'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'fALsE'</span><span class="p">)</span> </pre></div> <p>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 <code>nil</code> for these inputs. </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">-- These return nil:</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">({})</span> <span class="n">yesno</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="kr">function</span><span class="p">()</span> <span class="kr">return</span> <span class="s1">'This is a function.'</span> <span class="kr">end</span><span class="p">)</span> <span class="c1">-- These return true:</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">,</span> <span class="kc">true</span><span class="p">)</span> <span class="n">yesno</span><span class="p">({},</span> <span class="kc">true</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="kc">true</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="kr">function</span><span class="p">()</span> <span class="kr">return</span> <span class="s1">'This is a function.'</span> <span class="kr">end</span><span class="p">,</span> <span class="kc">true</span><span class="p">)</span> <span class="c1">-- These return "bar":</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">,</span> <span class="s1">'bar'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">({},</span> <span class="s1">'bar'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="s1">'bar'</span><span class="p">)</span> <span class="n">yesno</span><span class="p">(</span><span class="kr">function</span><span class="p">()</span> <span class="kr">return</span> <span class="s1">'This is a function.'</span> <span class="kr">end</span><span class="p">,</span> <span class="s1">'bar'</span><span class="p">)</span> </pre></div> <p>Note that the blank string also functions this way: </p> <div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span></span><span class="n">yesno</span><span class="p">(</span><span class="s1">''</span><span class="p">)</span> <span class="c1">-- Returns nil.</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">''</span><span class="p">,</span> <span class="kc">true</span><span class="p">)</span> <span class="c1">-- Returns true.</span> <span class="n">yesno</span><span class="p">(</span><span class="s1">''</span><span class="p">,</span> <span class="s1">'bar'</span><span class="p">)</span> <span class="c1">-- Returns "bar".</span> </pre></div> <p>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. </p> <div style="clear:both"> </div></div><table id="documentation-meta-data" class="plainlinks plainlinks fmbox fmbox-system" role="presentation"><tbody><tr><td class="mbox-text" style="font-size: small">上述文档嵌入自<a href="/wiki/Module:Yesno/doc" title="Module:Yesno/doc">Module:Yesno/doc</a>。 <small style="font-style: normal;">(<a class="external text" href="https://zh.wikisource.org/w/index.php?title=Module:Yesno/doc&action=edit">编辑</a> | <a class="external text" href="https://zh.wikisource.org/w/index.php?title=Module:Yesno/doc&action=history">历史</a>)</small><br />编者可以在本模块的沙盒 <small style="font-style: normal;">(<a class="external text" href="https://zh.wikisource.org/w/index.php?title=Module:Yesno/sandbox&action=edit&preload=Template%3ADocumentation%2Fpreload-module-sandbox">创建</a> | <a class="external text" href="https://zh.wikisource.org/w/index.php?title=Module:Yesno/sandbox&preload=Module%3AYesno&action=edit&summary=%E5%BB%BA%E7%AB%8B%5B%5BModule%3AYesno%5D%5D%E7%9A%84%E6%B2%99%E7%9B%92%E7%89%88%E6%9C%AC">镜像</a>)</small>和测试样例 <small style="font-style: normal;">(<a class="external text" href="https://zh.wikisource.org/w/index.php?title=Module:Yesno/testcases&action=edit&preload=Template%3ADocumentation%2Fpreload-module-testcases">创建</a>)</small>页面进行实验。<br /> <a href="/wiki/Special:%E5%89%8D%E7%BC%80%E7%B4%A2%E5%BC%95/Module:Yesno/" title="Special:前缀索引/Module:Yesno/">本模块的子页面</a>。</td></tr></tbody></table> <p><span id="code"></span> </p><div class="mw-highlight mw-highlight-lang-lua mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span id="L-1"><a href="#L-1"><span class="linenos" data-line="1"></span></a><span class="c1">-- Function allowing for consistent treatment of boolean-like wikitext input.</span> </span><span id="L-2"><a href="#L-2"><span class="linenos" data-line="2"></span></a><span class="c1">-- It works similarly to the template {{yesno}}.</span> </span><span id="L-3"><a href="#L-3"><span class="linenos" data-line="3"></span></a> </span><span id="L-4"><a href="#L-4"><span class="linenos" data-line="4"></span></a><span class="kr">return</span> <span class="kr">function</span> <span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="n">default</span><span class="p">)</span> </span><span id="L-5"><a href="#L-5"><span class="linenos" data-line="5"></span></a> <span class="c1">-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you</span> </span><span id="L-6"><a href="#L-6"><span class="linenos" data-line="6"></span></a> <span class="c1">-- should replace "val:lower()" with "mw.ustring.lower(val)" in the</span> </span><span id="L-7"><a href="#L-7"><span class="linenos" data-line="7"></span></a> <span class="c1">-- following line.</span> </span><span id="L-8"><a href="#L-8"><span class="linenos" data-line="8"></span></a> <span class="n">val</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="o">==</span> <span class="s1">'string'</span> <span class="ow">and</span> <span class="n">val</span><span class="p">:</span><span class="n">lower</span><span class="p">()</span> <span class="ow">or</span> <span class="n">val</span> </span><span id="L-9"><a href="#L-9"><span class="linenos" data-line="9"></span></a> <span class="kr">if</span> <span class="n">val</span> <span class="o">==</span> <span class="kc">nil</span> <span class="kr">then</span> </span><span id="L-10"><a href="#L-10"><span class="linenos" data-line="10"></span></a> <span class="kr">return</span> <span class="kc">nil</span> </span><span id="L-11"><a href="#L-11"><span class="linenos" data-line="11"></span></a> <span class="kr">elseif</span> <span class="n">val</span> <span class="o">==</span> <span class="kc">true</span> </span><span id="L-12"><a href="#L-12"><span class="linenos" data-line="12"></span></a> <span class="ow">or</span> <span class="n">val</span> <span class="o">==</span> <span class="s1">'yes'</span> </span><span id="L-13"><a href="#L-13"><span class="linenos" data-line="13"></span></a> <span class="ow">or</span> <span class="n">val</span> <span class="o">==</span> <span class="s1">'y'</span> </span><span id="L-14"><a href="#L-14"><span class="linenos" data-line="14"></span></a> <span class="ow">or</span> <span class="n">val</span> <span class="o">==</span> <span class="s1">'true'</span> </span><span id="L-15"><a href="#L-15"><span class="linenos" data-line="15"></span></a> <span class="ow">or</span> <span class="n">val</span> <span class="o">==</span> <span class="s1">'t'</span> </span><span id="L-16"><a href="#L-16"><span class="linenos" data-line="16"></span></a> <span class="ow">or</span> <span class="n">val</span> <span class="o">==</span> <span class="s1">'是'</span> </span><span id="L-17"><a href="#L-17"><span class="linenos" data-line="17"></span></a> <span class="ow">or</span> <span class="nb">tonumber</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span> </span><span id="L-18"><a href="#L-18"><span class="linenos" data-line="18"></span></a> <span class="kr">then</span> </span><span id="L-19"><a href="#L-19"><span class="linenos" data-line="19"></span></a> <span class="kr">return</span> <span class="kc">true</span> </span><span id="L-20"><a href="#L-20"><span class="linenos" data-line="20"></span></a> <span class="kr">elseif</span> <span class="n">val</span> <span class="o">==</span> <span class="kc">false</span> </span><span id="L-21"><a href="#L-21"><span class="linenos" data-line="21"></span></a> <span class="ow">or</span> <span class="n">val</span> <span class="o">==</span> <span class="s1">'no'</span> </span><span id="L-22"><a href="#L-22"><span class="linenos" data-line="22"></span></a> <span class="ow">or</span> <span class="n">val</span> <span class="o">==</span> <span class="s1">'n'</span> </span><span id="L-23"><a href="#L-23"><span class="linenos" data-line="23"></span></a> <span class="ow">or</span> <span class="n">val</span> <span class="o">==</span> <span class="s1">'false'</span> </span><span id="L-24"><a href="#L-24"><span class="linenos" data-line="24"></span></a> <span class="ow">or</span> <span class="n">val</span> <span class="o">==</span> <span class="s1">'f'</span> </span><span id="L-25"><a href="#L-25"><span class="linenos" data-line="25"></span></a> <span class="ow">or</span> <span class="n">val</span> <span class="o">==</span> <span class="s1">'否'</span> </span><span id="L-26"><a href="#L-26"><span class="linenos" data-line="26"></span></a> <span class="ow">or</span> <span class="nb">tonumber</span><span class="p">(</span><span class="n">val</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span> </span><span id="L-27"><a href="#L-27"><span class="linenos" data-line="27"></span></a> <span class="kr">then</span> </span><span id="L-28"><a href="#L-28"><span class="linenos" data-line="28"></span></a> <span class="kr">return</span> <span class="kc">false</span> </span><span id="L-29"><a href="#L-29"><span class="linenos" data-line="29"></span></a> <span class="kr">else</span> </span><span id="L-30"><a href="#L-30"><span class="linenos" data-line="30"></span></a> <span class="kr">return</span> <span class="n">default</span> </span><span id="L-31"><a href="#L-31"><span class="linenos" data-line="31"></span></a> <span class="kr">end</span> </span><span id="L-32"><a href="#L-32"><span class="linenos" data-line="32"></span></a><span class="kr">end</span> </span></pre></div> <!-- NewPP limit report Parsed by mw‐web.codfw.main‐7fc47fc68d‐wtclt Cached time: 20241128182610 Cache expiry: 2592000 Reduced expiry: false Complications: [vary‐revision‐sha1] CPU time usage: 0.086 seconds Real time usage: 0.197 seconds Preprocessor visited node count: 72/1000000 Post‐expand include size: 8867/2097152 bytes Template argument size: 30/2097152 bytes Highest expansion depth: 9/100 Expensive parser function count: 10/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 7649/5000000 bytes Lua time usage: 0.028/10.000 seconds Lua memory usage: 956169/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 159.036 1 Template:Documentation 100.00% 159.036 1 -total 3.53% 5.612 1 Template:Tl 1.66% 2.646 1 Template:Transclude --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1&useformat=desktop" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">检索自“<a dir="ltr" href="https://zh.wikisource.org/w/index.php?title=Module:Yesno&oldid=2488009">https://zh.wikisource.org/w/index.php?title=Module:Yesno&oldid=2488009</a>”</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Special:%E9%A1%B5%E9%9D%A2%E5%88%86%E7%B1%BB" title="Special:页面分类">分类</a>:<ul><li><a href="/wiki/Category:%E4%BD%BF%E7%94%A8%E5%B7%B2%E5%BC%83%E7%94%A8source%E6%A0%87%E7%AD%BE%E7%9A%84%E9%A1%B5%E9%9D%A2" title="Category:使用已弃用source标签的页面">使用已弃用source标签的页面</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> 此页面最后编辑于2024年11月5日 (星期二) 02:28。</li> <li id="footer-info-copyright">本站的全部文字在<a rel="nofollow" class="external text" href="//creativecommons.org/licenses/by-sa/4.0/deed.zh">知识共享 署名-相同方式共享 4.0协议</a>之条款下提供,附加条款亦可能应用。(请参阅<a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">使用条款</a>)<br />在部份国家和地区,包括中国大陆、澳门和台湾,作者精神权(含署名权)永久有效(<b><a href="/wiki/Wikisource:%E7%89%88%E6%9D%83%E4%BF%A1%E6%81%AF" title="Wikisource:版权信息">详情</a></b>)。<br /> Wikisource®和维基文库标志是<a rel="nofollow" class="external text" href="https://wikimediafoundation.org/zh">维基媒体基金会</a>的注册商标;维基™是维基媒体基金会的商标。<br />维基媒体基金会是在美国佛罗里达州登记的501(c)(3)<a class="external text" href="https://donate.wikimedia.org/wiki/Special:MyLanguage/Tax_deductibility">免税</a>、非营利、慈善机构。<br /></li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">隐私政策</a></li> <li id="footer-places-about"><a href="/wiki/Wikisource:%E5%85%B3%E4%BA%8E">关于维基文库</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikisource:%E5%85%8D%E8%B4%A3%E5%A3%B0%E6%98%8E">免责声明</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">行为准则</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">开发者</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/zh.wikisource.org">统计</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie声明</a></li> <li id="footer-places-mobileview"><a href="//zh.m.wikisource.org/w/index.php?title=Module:Yesno&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">手机版视图</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-7fc47fc68d-wtclt","wgBackendResponseTime":459,"wgPageParseReport":{"limitreport":{"cputime":"0.086","walltime":"0.197","ppvisitednodes":{"value":72,"limit":1000000},"postexpandincludesize":{"value":8867,"limit":2097152},"templateargumentsize":{"value":30,"limit":2097152},"expansiondepth":{"value":9,"limit":100},"expensivefunctioncount":{"value":10,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":7649,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 159.036 1 Template:Documentation","100.00% 159.036 1 -total"," 3.53% 5.612 1 Template:Tl"," 1.66% 2.646 1 Template:Transclude"]},"scribunto":{"limitreport-timeusage":{"value":"0.028","limit":"10.000"},"limitreport-memusage":{"value":956169,"limit":52428800}},"cachereport":{"origin":"mw-web.codfw.main-7fc47fc68d-wtclt","timestamp":"20241128182610","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>