Module:RoundN/doc: Difference between revisions

Content deleted Content added
shorthand function
Line 2:
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
== Usage ==
This is a module for meta templates such as {{t|Round16}}, {{t|Round8}}, etc. Though originally designed for sports, it can be used to present any tree.
 
Basic form:
<pre>{{#invoke:RoundN|main|columns = [number of columns (3 columns for Round8, 4 columns for Round16, etc.)]}}</pre>
 
Alternatively, the shorthand form <code><nowiki>{{#invoke:RoundN|N16}}</nowiki></code> (or any power of 2 between N2 and N512) is equivalent to {{code|{{#invoke:RoundN{{!}}main{{!}}columns = 4}}}}
 
==Parameter List==
*{{red|red}} parameter names are required.
*''italicized'' parameter names are required in some cases
*{{blue|blue}} parameter names involve new features not available prior to the release of this module
Line 20 ⟶ 24:
'''Note'''
* For <code>columns</code> ''less than 4'' (i.e. Round2-Round8), the 3rd Place match box is hidden by default. For <code>columns</code> ''greater or equal to 4'', the 3rd Place match box is visible by default. This reflects the behavior of the templates prior to this module's release.
 
{{TOC tab|'''Shorthand'''|shorthand|depth=2}}
While required for invoking the main function (<code><nowiki>{{#invoke:RoundN|main|columns=}}</nowiki></code>), this module has meta functions in the form of 'N##' which can call main with the right {{code|columns}} for you. For example, you may replace <code>... |main|columns = 7...</code> with <code>...|N128 ...</code>. Valid for N# where # is a power of 2. You must invoke this module directly to use this (vs. a template that already has a columns value). Only works up to N512. If say N1024 ever becomes necessary, call main directly and set {{para|columns|10}}.
 
<small>PS: Though adding shorthands up to N ~70 trillion would be easy, it would make unnecessary overhead as these meta functions are generated eached time this module is called (granted generating such functions up to ~70 trillion is probably less expensive than making the table for columns = 3).</small>
 
|-
Line 114 ⟶ 123:
|style='text-align:center;vertical-align:top'|{{TOC tab|RD##}}
|style='background-color:#fff'|Use <code>RD#</code>, replacing # with the desired column such that 1 is the leftmost round and X is the rightmost when <code>columns = X</code>. For example:
{{demo|<nowiki>{{#invoke:RoundN|main|columns=7N128
|RD2 = {{red|'''SECOND ROUND'''}}|RD7 = {{red|'''Championship'''}} | RD8 = {{red|'''So close, yet so far'''}}
|scroll_height=15em
|1}}</nowiki>}}
'''Note''' RD[N+1] = Third Place, and will perform the job of the <code>Consol</code> parameter if the latter is omitted, i.e. RD[N+1] is ignored if Consol is true. Also, this alternate name for Consol was not available prior to the release of this module (and is provided because the module's programmer thought 'Consol' was unintuitive).
|-