Module:LoadData/doc: Difference between revisions

Content deleted Content added
Usage: Add some docs
mNo edit summary
 
(6 intermediate revisions by 4 users not shown)
Line 1:
{{Module rating|alphaprotected}}
<!-- Please, place this module categories and this documentation interwikis where indicated at the bottom of this page. andThis module interwikis go at Wikidata (see [[Wikipedia:Wikidata]]). Thanks! -->
 
A more complex version of [[Module:Data]] with more options and the ability to select indexes with an inequality operator.
 
== Usage ==
<code><nowiki>{ &#123;{</nowiki>#invoke:{{BASEPAGENAME}}|''Module name''|index1|2 lteq=index2 limit|...|}}</code>
 
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|''Module name''|index1|2 lteq=index2 limit|...|}}</code>
 
* Zeroth parameter is the name of the data module to read, without ''Module:'', e.g. <code>Example/data</code>
* Next parameters, for an index {{varVar|N}} starting at one, are called {{paraPara|{{varVar|N}}}} for the exact index you need, coerced to number if possible, {{paraPara|{{varVar|N}} lteq}} to select the highest numerical index less than or equal to the argument, or {{paraPara|{{varVar|N}} gteq}} for the opposite.
* {{paraPara|template}} is a ''printf''-style string to interpolate the resulting value(s) into, e.g. <code><nowiki><b>%s</b></nowiki></code>.
* {{paraPara|preprocess}} is like {{paraPara|template}} except that <code>frame:preprocess</code> is run on it; this makes e.g. template transclusions work.
* {{paraPara|if nil}} is the string to return if the result is nil. Default is nil, which comes out as the empty string.
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandboxSandbox other| |
<!-- CategoriesPlease, belowadd this line,module please;categories interwikisbelow atthis line. WikidataThanks! -->
 
}}</includeonly><noinclude>
[[Category:Module documentation pages]]
<!-- Please, add this documentation interwikis below this line. Thanks! -->
[[pt:Módulo:LoadData/doc]]
</noinclude>