Module:RoundN/doc: Difference between revisions

Content deleted Content added
add testcases link for dundocumented features
cat
 
(24 intermediate revisions by 11 users not shown)
Line 1:
{{Module rating |alpha<!-- Values: pre-alpha • alpha • beta • release • protected -- If a rating not needed/relevant, delete this template call -->}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{High-use}}
{{Module rating |release<!-- Values: pre-alpha • alpha • beta • release • protected -- If a rating not needed/relevant, delete this template call -->}}
 
== Usage ==
This is a module for meta templates such as {{tl|Round16}}, {{tl|Round8}}, etc. Though originally designed for sports, it can be used to present any tree.
Line 9 ⟶ 11:
Alternatively, the shorthand form <code><nowiki>{{#invoke:RoundN|N16}}</nowiki></code> (or any power of 2 between N2 and N512) is equivalent to {{code|<nowiki>{{#invoke:RoundN|main|columns = 4}}</nowiki>}}
 
==Parameter Listlist==
*{{red|red}} parameter names are required.
*''italicized'' parameter names are required in some cases
Line 48 ⟶ 50:
 
{{Module talk:RoundN/testcases/1|param=style|style=width:20em;font-size:70%}}
 
To center-align the whole block, use <code>style=margin:auto;</code>
 
|-
Line 93 ⟶ 97:
 
|style='text-align:center;vertical-align:top'|{{TOC tab|{{blue|bold_winner}}}}
|style='background-color:#fff'|The {{code|boldwinnerbold_winner}} 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.
====Example 2====
{{Module talk:RoundN/testcases/2}}
Line 154 ⟶ 158:
|color=yes
|3rdplace=yes
|7|GoldTeam medalistA|3|SilverTeam medalistB|2
|8|BronzeTeam medalistC|1|Team D|0
}}
 
* '''Note:''' When <code><nowiki>|color=yes</nowiki></code> is set, the brackets are hardcoded to be colored as shown in the example above. To color the "correct" cells, you must also activate '''''bold_winner''''' to either ''high'' or ''low''. Thus allowing the module to identify and color the winners and losers correctly.
----
Add <code><nowiki>|color=yes & |bold_winner=high</nowiki></code> for colored brackets when the winner is the ''highest scorer''.
{{#invoke:RoundN|main|columns=1
|bold_winner=high
|color=yes
|3rdplace=yes
|7|Silver medalist|2|Gold medalist|3
|8||0|Bronze medalist|1
}}
 
----
Add <code><nowiki>|color=yes & |bold_winner=low</nowiki></code> for colored brackets when the winner is the ''lowest scorer''.
{{#invoke:RoundN|main|columns=1
|bold_winner=low
|color=yes
|3rdplace=yes
|7|Gold medalist|2|Silver medalist|3
|8|Bronze medalist|0||1
}}
 
|-
 
|style='text-align:center;vertical-align:top'|{{TOC tab|color_repechage}}
|style='background-color:#fff'|Add <code><nowiki>|color_repechage=yes</nowiki></code> for repechage brackets, where the winner is awarded a bronze medal.
{{#invoke:RoundN|main|columns=1
|color_repechage=yes
|7|Team A|3|Team B|2
}}
 
* '''Note 1:''' When <code><nowiki>|color_repechage=yes</nowiki></code> is set, the brackets are hardcoded to be colored as shown in the example above. To color the "correct" cells, you must also activate '''''bold_winner''''' to either ''high'' or ''low''. Thus allowing the module to identify and color the winners and losers correctly.
 
* '''Note 2:''' When <code><nowiki>|color_repechage=yes</nowiki></code> is set AND the final match of the brackest is skipped, as in cases where there are two bronze medalists, all winners of the final stage visible will be colored bronze.
----
Add <code><nowiki>|color_repechage=yes & |bold_winner=high</nowiki></code> for colored brackets when the winner is the ''highest scorer''.
{{#invoke:RoundN|main|columns=1
|bold_winner=high
|color_repechage=yes
|7|Team A|3|Team B|2
}}
----
Add <code><nowiki>|color_repechage=yes & |bold_winner=low</nowiki></code> for colored brackets when the winner is the ''lowest scorer''.
{{#invoke:RoundN|main|columns=1
|bold_winner=low
|color_repechage=yes
|7|Team A|3|Team B|2
}}
----
Add <code><nowiki>|color_repechage=yes & skip the final match of the brackets</nowiki></code> for colored brackets when there are two bronze medalists.
{{#invoke:RoundN|main|columns=3
|bold_winner = high
|color_repechage = yes
|flex_tree = yes
|skipmatch = 2;4;7
|omit_blanks = yes
|RD1 = Repechage
|RD2 = Bronze medal
|RD3 = omit_label
|1|Team A|3|Team B|2
|2|Team C|6|Team D|5
|3|Team A|8|Team E|7
|4|Team C|10|Team F|11
}}
 
Line 175 ⟶ 243:
|-
 
|style='text-align:center;vertical-align:top'|{{TOC tab|templatescore-boxes}}
|style='background-color:#fff'|Set <code>score-boxes</code> to the desired number of score boxes per match. (Default is 1). The number can be followed by <code> + sum</code>, which will add one more score box with the sum of all the others. For examples, see [[Module_talk:RoundN/testcases/5|test case 5]] and [[Module_talk:RoundN/testcases/6|test case 6]].
|style='background-color:#fff'|Set <code>|template=yes</code> if used to create a template for a specific game (add V.T.E. link using {{tl|navbar}}).
 
|-
 
|style='text-align:center;vertical-align:top'|{{TOC tab|Undocumented featuresflex_tree}}
|style='background-color:#fff'|AlasSet [[:User:CodeHydro]]<code>|flex_tree=yes</code> seriouslyto overbuiltmake thisthe modulebrackets andvertically nevermore foundcompact. theThat timeis, to documenthave evenless halfspace thebetween featuresmatches available. Check outof the followingsame examples which may contain some advanced features:round.
{{#invoke:RoundN|N4
{{Special:PrefixIndex/Module talk:RoundN/testcases}}
| 3rdplace = no
| flex_tree = yes
}}
|-
 
|style='text-align:center;vertical-align:top'|{{TOC tab|short_brackets}}
|style='background-color:#fff'|Set <code>|short_brackets=yes</code> to make the brackets horizontally more compact. That is, to have less space between matches of following rounds.
{{#invoke:RoundN|N4
| 3rdplace = no
| short_brackets = yes
}}
|}
 
==Node Functions==
{{Ombox
|type=notice
|text=Some of these functions are still in alpha testing and may not be stable. Please feel free to comment at the [[Module_talk:RoundN|talk page]].
}}
 
For greater customization, node functions may be added to the parameter usually used for providing match information such as dates and ___location. Simply insert <code>node_function{''function name''}</code> in the appropriate ___location. A demonstration of most of the node functions can be found at [[Module_talk:RoundN/testcases/4|RoundN/testcases/4]].
 
* '''orphan''' - Current node is disconnected from all other nodes (no lines will be drawn). One practical use for this may be when the winners of the previous round advance to a different tournament instead of playing each other but the losers still play a consolation match for 3rd place, as per [[Module talk:RoundN#Lines_between_matches_not_in_line_with_centre_of_box|this discussion]].
 
For the next three node functions, the parameters usually used for team names and scores should be omitted if these node functions are used.
* '''line''' - Current node is omitted and replaced with a horizontal line. Text may be displayed above this line via <code>node_function{line(''text'')}</code> (at some point, the preferred format would be <code>node_function{line}''text''</code> to match the form of the canvas function though backwards compatibility would probably be maintained). If [[Bracket#Curly_brackets|curly brackets]] are desired in the text, make sure to escape them with <code>\</code>.
* '''bridge''' - Current node is omitted and replaced with a vertical line.
* '''canvas''' - Current node is replaced with whatever you want via <code>node_function{canvas}''anything''</code>
* '''heading''' - <u>Not yet implemented.</u> Planned node function with the form <code>node_function{heading(''name'')}''date/___location''</code>. Makes a round name heading like for the [[Module:RoundN#Consol|Consol]] parameter, but may be placed anywhere, as per the "Elimination Rounds" of [[Module_talk:RoundN/testcases/6|RoundN/testcases/6]] (which currently renders the planned output of this function without the functions).
 
==Undocumented features==
Alas [[:User:Codehydro]] seriously overbuilt this module and never found the time to document even half the features available. Check out the following examples which may contain some advanced features:
{{Special:PrefixIndex/Module talk:RoundN/testcases}}
 
===Partial List of undocumented params===
*no_column_head
*branch_upwards
 
Note that some of these features may not have been documented due to incomplete implementation.
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Sports modules]]
 
}}</includeonly>