Module:RoundN/doc: Difference between revisions

Content deleted Content added
more params
No edit summary
Line 6:
 
==Parameter List==
*'''bold'''{{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
{| class='wikitable' style='width:75%'
! Parameter name
Line 14 ⟶ 15:
|-
 
|style='text-align:center;vertical-align:top;width:9em'| {{TOC tab|'''{{red|columns'''}}}}
|style='background-color:#fff'|Number of columns/eliminations (3 columns for Round8, 4 columns for Round16, etc.)
 
Line 25 ⟶ 26:
|style='background-color:#fff'|Unnamed parameters (i.e. a value not prefixed by <code>[param_name] =</code>) are read sequentially in groups of 5 such that:
====Example 1====
{{demo|<prenowiki>{{#invoke:RoundN|main|columns=2
|Day 1|A|'''7'''|B|5
|Day 2|C||D|
|tdb|A|||
}}</prenowiki>}}
{{#invoke:RoundN|main|columns=2
|Day 1|A|'''7'''|B|5
|Day 2|C||D|
|tdb|A|||
}}
Placing each group of 5 on a new line is optional, but does make it easier to read. Also, consider adding the comments such as <code><nowiki><!-- Date-Place/Team 1/Score 1/Team 2/Score 2 --></nowiki></code> on top and <code><nowiki><!-- Finals --></nowiki></code> above the first group of 5 in the finals round, etc.
 
|-
 
|style='text-align:center;vertical-align:top'| {{TOC tab|skipmatch[#]{{blue|style}}}}
|style='background-color:#fff'|No boxes will be shown forSet the #th match group. For example, adding <code><nowiki>|</nowiki>skipmatch2=yesstyle</code> parameter to '''Exampleadd 1'''custom willCSS resultto inthe table.
 
{{#invoke:RoundN|main|columns=2|skipmatch2=yes
{{Module talk:RoundN/testcases/1|param=style|style=width:20em;font-size:70%}}
|Day 1|A|'''7'''|B|5
 
|Day 2|C||D|
|-
|tdb|A|||
 
}}
|style='text-align:center;vertical-align:top'|{{TOC tab|''{{blue|scroll_height}}''}}
Useful for playoffs or when the number of teams playing in a round is not a power of 2. Unlike in the original template, this module does not require leading zeroes in this parameter, i.e. skipmatch001 is the same as skipmatch1 (though it may make your template code easier to read if lead with an appropriate number of zeroes).
|style='background-color:#fff'| For large tables, set {{code|scroll_height}} to the desired height in pixels.
 
{{Module talk:RoundN/testcases/1|param=scroll_height|scroll_height=140}}
 
CSS units are also allowed (i.e. '20em', '30%', etc.).
 
'''Note''' This works by duplicating the entire table and then using CSS to lock the clone of the table to the top of the div. Conceivably, for extremely large tables, this can result in a significant amount of extra HTML code to download versus if {{code|scroll_head_unlock}} is used.
 
|-
 
|style='text-align:center;vertical-align:top'|{{TOC tab|{{blue|scroll_head_unlock}}}}
|style='background-color:#fff'| If it is desirable to have the round heading scroll with the table (such as if a larger viewing area is desired), set {{code|scroll_head_unlock}} to 'yes'
 
{{Module talk:RoundN/testcases/1|param=scroll_head_unlock|scroll_head_unlock=yes|scroll_height=140|example=the code the {{code|scroll_height}} example}}
|-
 
|style='text-align:center;vertical-align:top'| {{TOC tab|skipmatch##}}
|style='background-color:#fff'|If set, boxes for the #th match group will not be shown. Most often used for playoffs or when the number of teams playing in the first round is not a power of 2.
{{Module talk:RoundN/testcases/1|param=skipmatch2|skipmatch2=yes}}
'''Note:'''
*Unlike in the original templates, this module does not require leading zeroes in this parameter, i.e. skipmatch001 is the same as skipmatch1 (though it may make your template code easier to read if lead with an appropriate number of zeroes).
*The 5 parameters that would have populated the skipped box will be ignored regardless of value unless <code>omit_blanks</code> is set to 'yes' (see below).
*Match skipping is currently only allowed in the first round (in this case, the 'Semi Finals'). For example, setting <code>columns=3</code> normally has 4 matches in the first round; thus, skipmatch5 and beyond will be ignored.
Line 54 ⟶ 69:
|-
 
|style='text-align:center;vertical-align:top'|{{TOC tab|{{blue|omit_blanks}}|depth=2}}
|style='background-color:#fff'|AddIf <code><nowiki>|omit_blanks=yes|skipmatch2=yes</nowiki></code> is set to '''Example 1'''yes, andthen all parameters that would have been skipped will instead be shifted to the next non-skipped box. (This is turned off by default because most templates made before the release of this module were required to use empty parameters as placeholders.)
{{#invokeModule talk:RoundN/testcases/1|mainparam=omit_blanks|columnsomit_blanks=2yes|skipmatch2=yes|omit_blanksexample=''Example 1'' with <code>{{!}}skipmatch2=yes</code>}}
|Day 1|A|'''7'''|B|5
|Day 2|C||D|
|tdb|A|||
}}
 
|-
 
|style='text-align:center;vertical-align:top'|{{TOC tab|{{blue|bold_winner}}}}
|style='background-color:#fff'|The {{code|boldwinner}} parameter accepts either {{code|'high'}} or {{code|'low'}}, which will automatically bold the text of the participant with the ''higher'' or ''lower'' score, respectively. In other words, set this to 'low' if the lower score wins and 'high' if the high score wins.
|style='background-color:#fff'|Instead of using wikimark-up to bold the names/scores, just set <code>bold_winner</code> like in the following:
====Example 2====
{{Module talk:RoundN/testcases/2}}
turned off by default because most templates made before the release of this module were required to use empty parameters as placeholders.)
<pre>{{#invoke:RoundN|main|columns=3
|bold_winner=yes
|widescore=yes
|Feb 1|A|7|B|5
|Feb 1|C|1|D|2
|Feb 1|E|3|F|5
|Feb 2|G||H|
|Feb 2|A|3 (5)|C|3 (6)
|Feb 3|F|||
}}</pre>
{{#invoke:RoundN|main|columns=3
|bold_winner=yes
|widescore=yes
|Feb 1|A|7|B|5
|Feb 1|C|1|D|2
|Feb 1|E|3|F|5
|Feb 2|G||H|
|Feb 2|A|3 (5)|C|3 (6)
|Feb 3|F|||
}}
'''Note:'''
* If entering a score that includes non-numbers{{--}}such as <code>3 (6)</code>, the Semi Final score for team C in the above example{{--}}the module will first remove all non-digit characters and concatenate the rest. For example, <code>3 (5)</code> and <code>3 (6)</code> would be converted to <code>35</code> and <code>36</code>, respectively, before being compared. This should be valid for most cases, however, you may override using the <code>manualboldmatch[#]#</code> parameter.
* If the scores are tied or contain no numbers, then neither will be bolded, however, you may still manually bold them with wikimarkup.
* Also modified by <code>low_score_wins</code> parameter.
* If scores are tied, neither are bolded.
 
|-
 
|style='text-align:center;vertical-align:top'|{{TOC tab|low_score_wins{{blue|manualboldmatch##}}|depth=2}}
|style='background-color:#fff'|
|style='background-color:#fff'|Add <code>|low_score_wins=yes</code> to '''Example 2''' to bold the team with the lower score if <code>bold_winner</code> is set to yes. (Example is cropped to save space)
{{Module talk:RoundN/testcases/2|result_arg=output|param=manualboldmatch1|manualboldmatch1=yes|before=In the same manner as the <code>skipmatch</code> parameters, you may use |after= on '''Example 2''' to prevent automatic bolding in the first group, etc. Again, leading zeroes may be added as desired.}}
<div style='height:150px;width:80%;overflow:scroll'>{{#invoke:RoundN|main|columns=3
|bold_winner=yes
|widescore=yes
|low_score_wins=yes
|Feb 1|A|7|B|5
|Feb 1|C|1|D|2
|Feb 1|E|3|F|5
|Feb 2|G||H|
|Feb 2|A|3 (5)|C|3 (6)
|Feb 3|F|||
}}</div>
 
|-
 
|style='text-align:center;vertical-align:top'|{{TOC tab|manualboldmatch[RD##]|depth=2}}
|style='background-color:#fff'|In the same manner as theUse <code>skipmatchRD#</code> parameters, youreplacing may# usewith <code>|manualboldmatch1=yes</code>the ondesired '''Examplecolumn 2'''such tothat prevent1 automaticis boldingthe inleftmost theround firstand group,N etc.is Again,the leadingrightmost zeroeswhen may<code>columns be= addedN</code>. asFor desired.example:
{{demo|<nowiki>{{#invoke:RoundN|main|columns=7
<div style='height:150px;width:80%;overflow:scroll'>
|RD1 = Auditions|RD3 = Blah Blah|RD7 = Championship
{{#invoke:RoundN|main|columns=3
|style=display:inline-block;height:15em;max-width:80%;overflow:auto;border:2px solid;padding:2px
|bold_winner=yes
|1}}</nowiki>}}
|widescore=yes
|low_score_wins=yes
|manualboldmatch1=yes
|Feb 1|A|7|B|5
|Feb 1|C|1|D|2
|Feb 1|E|3|F|5
|Feb 2|G||H|
|Feb 2|A|3 (5)|C|3 (6)
|Feb 3|F|||
}}</div>
 
|-
 
|style='text-align:center;vertical-align:top'|{{TOC tab|RD[#]Consol|depth=2}}
|style='background-color:#fff'|UseSet <code>RD#Consol=name</code>, replacingto # withchange the desired'Third columnPlace' suchlabel thatto 1 is the leftmost round and N is the rightmost when <code>columns = N</code>'name'. For example:
<pre>{{#invoke:RoundN|main|columns=71|3rdplace=yes|Consol=Runner up}}
 
|RD1 = Auditions|RD3 = Blah Blah|RD7 = Championship
}}</pre>
<div style='height:150px;width:80%;overflow:scroll'>
{{#invoke:RoundN|main|columns=7|
|RD1 = Auditions|RD3 = Blah Blah|RD7 = Championship
}}
</div>
|-
 
|style='text-align:center;vertical-align:top'|{{TOC tab|color}}
|style='background-color:#fff'|Add <code><nowiki>|color=yes</nowiki></code>
{{#invoke:RoundN|main|columns=31
|color=yes
|3rdplace=yes
Line 155 ⟶ 120:
|8|Bronze medalist|1||0
}}
|-
 
|style='text-align:center;vertical-align:top'|{{TOC tab|3rdplace}}
|style='background-color:#fff'|By default, <code><nowiki>|3rdplace=</code></nowiki> is set to 'yes' when <code>columns</code> is greater than 3 and 'no' otherwise. Override as desired.
 
|}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |