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

来自NebulaeWiki
(页面间差异)
无编辑摘要
标签已被回退
 
(已保护“模块:Yesno/doc”([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)))
 
第1行: 第1行:
<!--
{{Documentation}}
--><div id="home-featured" class="home-card home-card--button home-card--col2 home-card--row1">
{{Wikipedia template}}
<div class="home-card__background">[[文件:{{Main page/settings|featured-图像}}|x200px|link={{Main page/settings|featured}}]]</div>
 
<div class="home-card__foreground">
'''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.
<div class="home-card__label">精选内容</div>
<h3 class="home-card__header">{{Main page/settings|featured}}</h3>
</div>
</div><templatestyles src="Template:Main page/featured/styles.css"/><noinclude><!-- For preview only --><templatestyles src="Template:Main page/shared/styles.css" />{{/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.