“模板:Main page/editing”与“模块:Yesno/doc”:页面之间的差异

来自NebulaeWiki
(页面间差异)
无编辑摘要
标签手工回退 已被回退
 
(已保护“模块:Yesno/doc”([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)))
 
第1行: 第1行:
<includeonly><div id="home-editing" class="home-card home-card--col2 home-card--row1">
{{Documentation}}
<div class="home-editing__intro">
{{Wikipedia template}}
<h3 class="home-card__header">[[教程|开始编辑]]</h3>
 
<p>NebulaeWiki是由各位玩家共同建立的!<br>
'''Module:Yesno''' 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.
感谢所有编写者为NebulaeCraft做出的贡献!</p>
</div>
<div class="home-editing__stats">
<div class="home-stats">
<div class="home-stats__value">[[Special:AllPages|{{NUMBEROFARTICLES}}]]</div>
<div class="home-stats__unit">页面</div>
</div>
<div class="home-stats">
<div class="home-stats__value">[[Special:Statistics|{{NUMBEROFEDITS}}]]</div>
<div class="home-stats__unit">编辑</div>
</div>
</div>
</div><templatestyles src="Template:Main page/editing/styles.css"/></includeonly><noinclude>{{/doc}}</noinclude>

2023年9月23日 (六) 22:31的最新版本

Module:Yesno provides a consistent interface for processing boolean or boolean-style string input. While Lua allows the true and false 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 nil values as nil, to allow for distinctions between nil and false. 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 nil, it is possible to specify a default value to return.