Module:Build bracket/doc: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
{{#switch:{{NAMESPACE}}
| Module =
{{high-use|| Wikipedia talk:High-risk templates}}
{{Module rating|beta}}
 
This module is intended to be used to create and edit intricate sports brackets that cannot be made by [[Module:RoundN]] or [[Module:Team bracket]]. For example, additional headers (for double-elimination brackets; 3rd-, 5th-, 7th-place matches; etc), singular omitted matches (i.e., having a horizonal line instead of a match), and ''N''-way brackets (''N'' teams per match). The syntax is slightly more complicated than the aforementioned brackets, but simpler than using the standard wikitable code.
== Description ==
This template is intended to be used to create and edit intricate sports brackets that cannot be made by [[Module:RoundN]] or [[Module:Team bracket]]. For example, additional headers (for double-elimination brackets; 3rd-, 5th-, 7th-place matches; etc), singular omitted matches (i.e., having a horizonal line instead of a match), and ''N''-way brackets (''N'' teams per match). The syntax is slightly more complicated than the aforementioned brackets, but simpler than using the standard wikitable code.
 
}}
The template breaks down the brackets into rows and columns.
 
== Bracket builderUsage ==
{{#switch:{{NAMESPACE}}
<pre>
| Module =
<pre style="overflow:auto">
{{#invoke:Build bracket|main
| rounds =
Line 27 ⟶ 31:
}}
</pre>
| #default = {{#tag:syntaxhighlight|
 
{{((}}{{BASEPAGENAME}}<nowiki>
{| border=1 cellpadding=0 cellspacing=0 style="font-size: 90%; margin:1em 2em 1em 1em;" style="text-align:center"
| RD1 =
|-
| RD1-seed1 =
| style="border:0;" | || style="border:0;" | || style="border:0;" | <code>1</code> || style="border:0;" | <code>2</code> || style="border:0;" | <code>3</code> || style="border:0;" | …
| RD1-team1 =
|-
| RD1-score1 =
| style="border:0;" | <code>1</code> || || || || || …
...</nowiki>
|-
{{))}}|lang=moin}}
| style="border:0;" | <code>2</code> || || || || || …
Per [[MOS:ACCESS#Font size]] and [[MOS:SMALLFONT]], "avoid using smaller font sizes in elements that already use a smaller font size, such as infoboxes, navboxes and reference sections". Since this template's text is already reduced to 90% of the normal size, use of the {{tl|Small}} template or {{tag|small}} tags within this template produces a font size that is 77% of the page default, well below the 85% minimum specified in the linked guidelines.
|-
}}
| style="border:0;" | <code>3</code> || || || || || …
|-
| style="border:0;" | <code>4</code> || || || || || …
|-
| style="border:0;" | ⋮ || || ⋮ || ⋮ || ⋮ || ⋱
|}
 
'''Note:''' Borders are not actually present. They are only here to help visualization.
 
=== Parameters ===
Line 50 ⟶ 47:
! Parameter !! Description !! Default
|-
{{#switch:{{NAMESPACE}}
| <code>rounds</code> || number of rounds (columns). || <code>1</code>
| Module =
|-
|{{!}} <code>rowsrounds</code> || manually set the{{!!}} number of rowsrounds (columns). ||{{!!}} Automatic<code>1</code>
{{!-}}
|-
|{{!}} <code>rows</code> {{!!}} manually set the number of rows. {{!!}} Automatic
{{!-}}
{{!}} <code>teams-per-match</code><br /> ||{{!!}} enter the number of teams in each match. Use <code>col<i>m</i>-teams-per-match</code> to set individual columns ||{{!!}} <code>2</code>
{{!-}}
|-
|{{!}} <code>col<i>m</i>-headers</code> ||{{!!}} (optional) enter the row numbers where headers are desired in column ''m''. Separate entries with <code>,</code>. Half integer values are allowed. ||{{!!}} Automatic
{{!-}}
|-
|{{!}} <code>col<i>m</i>-matches</code> ||{{!!}} enter the row numbers where a match is desired in column ''m''. Matches take up two rows by default. Separate entries with <code>,</code>. Half integer values are allowed. ||{{!!}}
{{!-}}
|-
|{{!}} <code>col<i>m</i>-lines</code> ||{{!!}} enter the row numbers where a line is desired (in leu of a match) in column ''m''. Separate entries with <code>,</code>. Half integer values are allowed. ||{{!!}}
{{!-}}
|-
|{{!}} <code>col<i>m</i>-col<i>m</i>+1-paths</code> ||{{!!}} enter the starting and ending row numbers, separated by <code>-</code>, from columns ''m'' and ''m''+1 where a path is desired. Separate entries with <code>,</code>. Half integer values are allowed. ||{{!!}}
{{!-}}
|-
|{{!}} colspan=3 | {{!}}
}}
|-
| <code>RD<i>m</i></code>, <code>RD<i>mh</i></code> || The header text of the (alpha ''h''th) header in column ''m'' (e.g., <code>RD1</code> for the first header and <code>RD1b</code> for the second header in round 1). ||
|-
| <code>RD<i>m</i>-seed<i>k</i></code> || The seed of the ''k''th team in column ''m''. Alternatively, use <code>RD<i>mh</i>-seed<i>k</i></code> for the ''k''th team under header ''mh''. ||
|-
| <code>RD<i>m</i>-team<i>k</i></code> || The name of the ''k''th team in column ''m''. Alternatively, use <code>RD<i>mh</i>-team<i>k</i></code> for the ''k''th team under header ''mh''. ||
|-
| <code>RD<i>m</i>-score<i>k</i></code> || The score of the ''k''th team in column ''m''. Alternatively, use <code>RD<i>mh</i>-score<i>k</i></code> for the ''k''th team under header ''mh''. Append the suffix <code>-<i>l</i></code> for the ''l''th leg or <code>-agg</code> for the aggregate score. ||
|-
| <code>RD<i>m</i>-text<i>k</i></code> || The text above the ''k''th match in column ''m''. Alternatively, use <code>RD<i>mh</i>-text<i>k</i></code> for the ''k''th match under header ''mh''. ||
|-
| colspan=3 |
|-
| <code>maxround</code> || maximum round to display. This parameter should be omitted unless it is less than the default value set by <code>rounds</code>.
Line 101 ⟶ 89:
|-
| <code>boldwinner</code> || set to <code>yes</code> to automatically bold the seed/team/score with the higher score in each match. || <code>no</code>
|-
| colspan=3 |
|-
| <code>RD<i>m</i></code>, <code>RD<i>mh</i></code> || The header text of the (alpha ''h''th) header in column ''m'' (e.g., <code>RD1</code> for the first header and <code>RD1b</code> for the second header in round 1). ||
|-
| <code>RD<i>m</i>-seed<i>k</i></code> || The seed of the ''k''th team in column ''m''. Alternatively, use <code>RD<i>mh</i>-seed<i>k</i></code> for the ''k''th team under header ''mh''. ||
|-
| <code>RD<i>m</i>-team<i>k</i></code> || The name of the ''k''th team in column ''m''. Alternatively, use <code>RD<i>mh</i>-team<i>k</i></code> for the ''k''th team under header ''mh''. ||
|-
| <code>RD<i>m</i>-score<i>k</i></code> || The score of the ''k''th team in column ''m''. Alternatively, use <code>RD<i>mh</i>-score<i>k</i></code> for the ''k''th team under header ''mh''. Append the suffix <code>-<i>l</i></code> for the ''l''th leg or <code>-agg</code> for the aggregate score. ||
|-
| <code>RD<i>m</i>-text<i>k</i></code> || The text above the ''k''th match in column ''m''. Alternatively, use <code>RD<i>mh</i>-text<i>k</i></code> for the ''k''th match under header ''mh''. ||
|}
{{#switch:{{NAMESPACE}}
 
| Module =
=== Path codes ===
Path codes are entered in the form <code>a-b</code>, where <code>a</code> is associated match in the first column, and <code>b</code> is associated match in the second column. Path codes can be grouped; for example, <code>(a,b)-c</code> is equivalent to <code>a-c, b-c</code>.
{{wikitable| class="wikitable"
|-
! Example !! Output
Line 117 ⟶ 118:
|<code>3-(1,5)</code>
| {{#invoke:Build bracket|main|rounds=2|noheaders=yes|col1-matches=3|col2-matches=1,5|col1-col2-paths=3-(1,5)}}
|}}
}}
 
== Examples ==
{{#switch:{{NAMESPACE}}
'''Note''': These are only examples. [[Module:Team bracket]] and [[Module:RoundN]] handle some of these brackets much better than this template does.
| Module =
'''Note''': These are only examples to illustrate parameters. Standard 4-team, 8-team, etc. brackets are better handled by [[Module:Team bracket]].
 
=== Standard 4-team bracket ===
<pre style="overflow: auto;">
 
<pre>
{{#invoke:Build bracket|main
| rounds=2
Line 162 ⟶ 165:
}}
 
=== No3-way seedsbracket ===
<pre>
{{#invoke:Build bracket|main
| rounds=2
| seedsteams-per-match = no3
 
| col1-headers = 1
| col2-headers = 1
 
| col1-matches = 3,7,11
| col2-matches = 37
 
| col1-col2-paths = 3-3
 
| col1-col2-paths = (3,7,11)-7
}}
</pre>
{{#invoke:Build bracket|main
| rounds=2
| seedsteams-per-match = no3
 
| col1-headers = 1
| col2-headers = 1
 
| col1-matches = 3,7,11
| col2-matches = 37
 
| col1-col2-paths = (3,7,11)-37
}}
 
=== Double-elimination bracket ===
<pre>
{{#invoke:Build bracket|main
| rounds=4
 
| col1-headers = 1,7
| col2-headers = 1,7
| col3-headers = 7
| col4-headers = 1
 
| col1-matches = 4,11
| col2-matches = 3,10
| col3-lines = 3
| col3-matches = 9
| col4-matches = 6
 
| col1-col2-paths = 4-3, 11-10
| col2-col3-paths = 3-3, 10-9
| col3-col4-paths = (3,9)-6
 
<!-- Defaults -->
| RD1 = Upper round 1
| RD2 = Upper final
| RD3b = Lower final
}}
</pre>
{{#invoke:Build bracket|main
| rounds=4
 
| col1-headers = 1,7
| col2-headers = 1,7
| col3-headers = 7
| col4-headers = 1
 
| col1-matches = 4,11
| col2-matches = 3,10
| col3-lines = 3
| col3-matches = 9
| col4-matches = 6
 
| col1-col2-paths = 4-3, 11-10
| col2-col3-paths = 3-3, 10-9
| col3-col4-paths = (3,9)-6
 
<!-- Defaults -->
| RD1 = Upper round 1
| RD2 = Upper final
| RD3b = Lower final
}}
}}
 
=== No seeds ===
{{#switch:{{NAMESPACE}}
| Module =
<pre style="overflow: auto;">
{{#invoke:Build bracket|main
| rounds=2
| seeds=no
 
| col1-matches = 3,7
| col2-matches = 5
 
| col1-col2-paths = (3,7)-5
}}
</pre>
{{#invoke:Build bracket|main
| rounds=2
| seeds=no
 
| col1-matches = 3,6
| col2-matches = 4.5
 
| col1-col2-paths = (3,6)-4.5
}}
|#default =
{{#tag:syntaxhighlight|
{{((}}{{BASEPAGENAME}}<nowiki>
| seeds = no
| RD1 =
| RD1-seed1 =
| RD1-team1 =
| RD1-score1 =
...</nowiki>
{{))}}|lang=moin}}
{{{{#if:{{{limitexamples|}}}|void|{{BASEPAGENAME}}}}|seeds=no}}
}}
 
=== Text ===
{{#switch:{{NAMESPACE}}
| Module =
<pre style="overflow: auto;">
{{#invoke:Build bracket|main
| rounds=2
| col1-matches = 3,6
| col2-matches = 4.5
| col1-col2-paths = (3,6)-4.5
 
| RD1-text1 = Text 1
| RD1-text2 = Text 2
| RD2-text1 = Text 3
}}
</pre>
{{#invoke:Build bracket|main
| rounds=2
| col1-matches = 3,6
| col2-matches = 4.5
| col1-col2-paths = (3,6)-4.5
 
| RD1-text1 = Text 1
| RD1-text2 = Text 2
| RD2-text1 = Text 3
}}
|#default =
{{#tag:syntaxhighlight|
{{((}}{{BASEPAGENAME}}<nowiki>
| RD1-text1 = RD1-text1
| RD1-text2 = RD1-text2
| RD2-text1 = RD2-text1
| RD1 =
| RD1-seed1 =
| RD1-team1 =
| RD1-score1 =
...</nowiki>
{{))}}|lang=moin}}
{{{{#if:{{{limitexamples|}}}|void|{{BASEPAGENAME}}}}|RD1-text1=Text 1|RD1-text2=Text 2|RD2-text1=Text 3}}
}}
 
=== Legs ===
{{#switch:{{NAMESPACE}}
<pre>
| Module =
<pre style="overflow: auto;">
{{#invoke:Build bracket|main
| rounds=3
| legs = 2
| RD3RD1-legs = 3
 
| col1-headersmatches = 13,6,9,12
| col2-headersmatches = 14.5,10.5
| col3-headersmatches = 17.5
 
| col1-matchescol2-paths = (3,6)-4.5, (9,12)-10.5
| col2-matchescol3-paths = (4.5,10.5)-7.5
| col3-matches = 3
 
| col1-col2-paths = 5-4
| col2-col3-paths = 4-3
}}
</pre>
{{#invoke:Build bracket|main
| rounds=3
| legs = 2
| RD1-legs = 3
 
| col1-matches = 3,6,9,12
| col2-matches = 4.5,10.5
| col3-matches = 7.5
 
| col1-col2-paths = (3,6)-4.5, (9,12)-10.5
| col2-col3-paths = (4.5,10.5)-7.5
}}
|#default =
{{#tag:syntaxhighlight|
{{((}}{{BASEPAGENAME}}<nowiki>
| legs = 2
| RD1-legs = 3
| RD1 =
| RD1-seed1 =
| RD1-team1 =
| RD1-score1-1=
| RD1-score1-2=
| RD1-score1-3=
...</nowiki>
{{))}}|lang=moin}}
{{{{#if:{{{limitexamples|}}}|void|{{BASEPAGENAME}}}}|legs=2|RD1-legs=3}}
}}
 
=== Aggregate ===
{{#switch:{{NAMESPACE}}
| Module =
<pre style="overflow: auto;">
{{#invoke:Build bracket|main
| rounds=3
| legs=2
| RD3-legsaggregate=3y
 
| col1-headersmatches = 13,6,9,12
| col2-headersmatches = 14.5,10.5
| col3-headersmatches = 17.5
 
| col1-matchescol2-paths = (3,6)-4.5, (9,12)-10.5
| col2-matchescol3-paths = (4.5,10.5)-7.5
}}
| col3-matches = 3
</pre>
{{#invoke:Build bracket|main
| rounds=3
| legs=2
| aggregate=y
 
| col1-matches = 3,6,9,12
| col2-matches = 4.5,10.5
| col3-matches = 7.5
 
| col1-col2-paths = 5(3,6)-4.5, (9,12)-10.5
| col2-col3-paths = (4.5,10.5)-37.5
}}
|#default =
{{#tag:syntaxhighlight|
{{((}}{{BASEPAGENAME}}<nowiki>
| legs=2
| aggregate=y
| RD1 =
| RD1-seed1 =
| RD1-team1 =
| RD1-score1-1 =
| RD1-score1-2 =
| RD1-score1-agg=
...</nowiki>
{{))}}|lang=moin}}
{{{{#if:{{{limitexamples|}}}|void|{{BASEPAGENAME}}}}|legs=2|aggregate=y}}
}}
 
{{#switch:{{NAMESPACE}}
=== 3-way bracket ===
| Module =
<pre>
=== Bold winner ===
<pre style="overflow: auto;">
{{#invoke:Build bracket|main
| rounds=2
| teams-per-matchlegs = 3
| boldwinner=y
| col1-matches = 3,7
| col2-matches = 5
| col1-col2-paths = (3,7)-5
 
| RD1-seed1 = 1 | RD1-team1 = Team 1 | RD1-score1-1 = 5 | RD1-score1-2 = 12 | RD1-score1-3 = 15
| col1-headers = 1
| RD1-seed2 = 4 | RD1-team2 = Team 2 | RD1-score2-1 = 11 | RD1-score2-2 = 10 | RD1-score2-3 = 4
| col2-headers = 1
 
| RD1-seed3 = 2 | RD1-team3 = Team 3 | RD1-score3-1 = 6 | RD1-score3-2 = 13 | RD1-score3-3 = {{ndash}}
| col1-matches = 3,7,11
| RD1-seed4 = 3 | RD1-team4 = Team 4 | RD1-score4-1 = 3 | RD1-score4-2 = 2 | RD1-score4-3 = {{ndash}}
| col2-matches = 7
 
| RD2-seed1 = 4 | RD2-team1 = Team 2 | RD2-score1-1 = 2 | RD2-score1-2 = 2 | RD2-score1-3 = 5
| col1-col2-paths = 3-7, 7-7, 11-7
| RD2-seed2 = 2 | RD2-team2 = Team 3 | RD2-score2-1 = 1 | RD2-score2-2 = 7 | RD2-score2-3 = 2
}}
</pre>
{{#invoke:Build bracket|main
| rounds=2
| teams-per-matchlegs = 3
| boldwinner=y
| col1-matches = 3,7
| col2-matches = 5
| col1-col2-paths = (3,7)-5
 
| RD1-seed1 = 1 | RD1-team1 = Team 1 | RD1-score1-1 = 5 | RD1-score1-2 = 12 | RD1-score1-3 = 15
| col1-headers = 1
| RD1-seed2 = 4 | RD1-team2 = Team 2 | RD1-score2-1 = 11 | RD1-score2-2 = 10 | RD1-score2-3 = 4
| col2-headers = 1
 
| RD1-seed3 = 2 | RD1-team3 = Team 3 | RD1-score3-1 = 6 | RD1-score3-2 = 13 | RD1-score3-3 = {{ndash}}
| col1-matches = 3,7,11
| RD1-seed4 = 3 | RD1-team4 = Team 4 | RD1-score4-1 = 3 | RD1-score4-2 = 2 | RD1-score4-3 = {{ndash}}
| col2-matches = 7
 
| RD2-seed1 = 4 | RD2-team1 = Team 2 | RD2-score1-1 = 2 | RD2-score1-2 = 2 | RD2-score1-3 = 5
| col1-col2-paths = 3-7, 7-7, 11-7
| RD2-seed2 = 2 | RD2-team2 = Team 3 | RD2-score2-1 = 1 | RD2-score2-2 = 7 | RD2-score2-3 = 2
}}
|#default=
 
{{{examples|}}}
<includeonly>{{Sandbox other||
}}
<!-- Categories below this path -->
== See also ==
{{#switch:{{NAMESPACE}}
| Module =
* [[Module:Team bracket]]
* [[Module:RoundN]]
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- Categories go here, and interwikis go in Wikidata -->
[[Category:Sports modules]]
 
}}</includeonly>
}}