Mòideal:RoundN/doc

O Wiktionary
Jump to navigation Jump to search

This is the documentation page for Mòideal:RoundN

(deasbaireachd • deasaich • eachdraidh • ceanglaichean • doc • bogsa-gainmhich • cùisean deuchainn)

Ùsaid - Usage

This is a module for meta templates such as {{Round16}}, {{Round8}}, etc. Though originally designed for sports, it can be used to present any tree.

Basic form:

{{#invoke:RoundN|main|columns = [number of columns (3 columns for Round8, 4 columns for Round16, etc.)]}}

Alternatively, the shorthand form {{#invoke:RoundN|N16}} (or any power of 2 between N2 and N512) is equivalent to {{#invoke:RoundN|main|columns = 4}}


Paramadairean - Parameters

  • Red parameter names are requiRed.
  • italicized parameter names are requiRed in some cases
  • Blue parameter names involve new features not available prior to the release of this module
Parameter name Description

==Script error: No such module "ustring".columnsScript error: No such module "ustring".==

columns
Number of columns/eliminations (3 columns for Round8, 4 columns for Round16, etc.)

Note

  • For columns less than 4 (i.e. Round2-Round8), the 3rd Place match box is hidden by default. For columns 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.

==Script error: No such module "ustring".shorthandScript error: No such module "ustring".==

Shorthand

While requiRed for invoking the main function ({{#invoke:RoundN|main|columns=}}), this module has meta functions in the form of 'N##' which can call main with the right columns for you. For example, you may replace ... |main|columns = 7... with ...|N128 .... 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 |columns=10.

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).

==Script error: No such module "ustring".{{{#}}}Script error: No such module "ustring".==

{{{#}}}
Unnamed parameters (i.e. a value not prefixed by [param_name] =) are read sequentially in groups of 5 such that:

Eisimpleir 1 - Example 1

{{#invoke:RoundN|main|columns=2
|Day 1|A|'''7'''|B|5
|Day 2|C||D|
|tdb|A|||
}}
 
Semi-finalsFinal
 
      
 
Day 1
 
 
A7
 
tdb
 
B5
 
A
 
Day 2
 
 
 
C
 
 
D
 

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 <!-- Date-Place/Team 1/Score 1/Team 2/Score 2 --> on top and <!-- Finals --> above the first group of 5 in the finals round, etc.

==Script error: No such module "ustring".styleScript error: No such module "ustring".==

style
Set the style parameter to add custom CSS to the table.

{{:w:en:Module talk:RoundN/testcases/1|param=style|style=width:20em;font-size:70%}}

==Script error: No such module "ustring".scroll_heightScript error: No such module "ustring".==

scroll_height
For large tables, set scroll_height to the desiRed height in pixels.

{{:w:en: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 scroll_head_unlock is used.

==Script error: No such module "ustring".scroll_head_unlockScript error: No such module "ustring".==

scroll_head_unlock
If it is desirable to have the round heading scroll with the table (such as if a larger viewing area is desiRed), set scroll_head_unlock to 'yes'

{{:w:en:Module talk:RoundN/testcases/1|param=scroll_head_unlock|scroll_head_unlock=yes|scroll_height=140|example=the code the scroll_height example}}

==Script error: No such module "ustring".skipmatch##Script error: No such module "ustring".==

skipmatch##
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.

{{:w:en:Module talk:RoundN/testcases/1|param=skipmatch2|skipmatch2=yes}}

==Script error: No such module "ustring".shorthand (range)Script error: No such module "ustring".==

NEW:

The shorthand |skipmatch = 1-2;4;6-7 will do the same thing as:

|skipmatch1=yes
|skipmatch2=yes
|skipmatch4=yes
|skipmatch6=yes
|skipmatch7=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 omit_blanks is set to 'yes' (see below).
  • Previously, skipmatch only worked in the first round. This limitation no longer applies. (See {{enUici|Module talk:RoundN/testcases/3]])

==Script error: No such module "ustring".omit_blanksScript error: No such module "ustring".==

omit_blanks
If omit_blanks is set to yes, then 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.)

{{:w:en:Module talk:RoundN/testcases/1|param=omit_blanks|omit_blanks=yes|skipmatch2=yes|example=Example 1 with |skipmatch2=yes}}

==Script error: No such module "ustring".bold_winnerScript error: No such module "ustring".==

bold_winner
The boldwinner parameter accepts either 'high' or '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.

Eisimpleir 2 - Example 2

{{:w:en:Module talk:RoundN/testcases/1}} Note:

  • If entering a score that includes non-numbersTeamplaid:--such as 3 (6), the Semi Final score for team C in the above exampleTeamplaid:--the module will first remove all non-digit characters and concatenate the rest. For example, 3 (5) and 3 (6) would be converted to 35 and 36, respectively, before being compaRed. This should be valid for most cases, however, you may override using the manualboldmatch## parameter.
  • If the scores are tied or contain no numbers, then neither will be bolded, however, you may still manually bold them with wikimarkup.
  • This does not remove any formatting already present.

==Script error: No such module "ustring".manualboldmatch##Script error: No such module "ustring".==

manualboldmatch##

{{:w:en:Module talk:RoundN/testcases/2|param=manualboldmatch1|param2=scroll_height|manualboldmatch1=yes|scroll_height=12em|result_arg=output|before=In the same manner as the skipmatch parameters, you may use |after= on Example 2 to prevent automatic bolding in the first group, etc. Again, as with skipmatch, leading zeroes may be added as desiRed.}}


==Script error: No such module "ustring".shorthand (range)Script error: No such module "ustring".==

Shorthand

The form manualboldmatch = 1-3;6;9-12 is also available.

==Script error: No such module "ustring".previewnumbersScript error: No such module "ustring".==

previewnumbers

Set |previewnumbers = yes to show numbers next to each match group (useful for skipmatch and manualboldmatch) when viewing on the template page.

Note that these numbers will not appear in article space.

==Script error: No such module "ustring".RD##Script error: No such module "ustring".==

RD##
Use RD#, replacing # with the desiRed column such that 1 is the leftmost round and X is the rightmost when columns = X. For example:
{{#invoke:RoundN|N128
|RD2 = {{Red|'''SECOND ROUND'''}}|RD7 = {{Red|'''Championship'''}} | RD8 = {{Red|'''So close, yet so far'''}}
|scroll_height=15em
}}

 
Round of 128SECOND ROUNDRound of 32Round of 16Quarter-finalsSemi-finalsChampionship
 
                          
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Note RD[N+1] = Third Place, and will perform the job of the Consol 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).

==Script error: No such module "ustring".3rdplaceScript error: No such module "ustring".==

3rdplace
By default, |3rdplace= is set to 'yes' when columns is greater than 3 and 'no' otherwise. Override as desiRed. (See Consol if you wish to rename this heading)
{{#invoke:RoundN|main|columns=1
|1
}}
 
Final
 
  
 
1
 
 
 
 
 
 
 

==Script error: No such module "ustring".ConsolScript error: No such module "ustring".==

Consol
Set Consol=name to change the 'Third Place' label to 'name'. You may also use the form RD# where # = columns + 1.
{{#invoke:RoundN|main|columns=1
|3rdplace=yes
|Consol=Runner up
|1
}}
 
Final
 
  
 
1
 
 
 
 
 
 
 
 
 
 
 
Runner up
 
 
 
 
 
 
 
 
 
 

==Script error: No such module "ustring".colorScript error: No such module "ustring".==

color
Add |color=yes
 
Final
 
  
 
7
 
 
Gold medalist3
 
 
Silver medalist2
 
 
 
 
 
Third place
 
 
8
 
 
Bronze medalist1
 
 
 0
 

==Script error: No such module "ustring".team-widthScript error: No such module "ustring".==

team-width
Set team-width to the desiRed width in pixels. (Default is 170)

==Script error: No such module "ustring".score-widthScript error: No such module "ustring".==

score-width
Set score-width to the desiRed width in pixels. (Default is 30)

==Script error: No such module "ustring".widescoreScript error: No such module "ustring".==

widescore
Setting |widescore=yes is basically equal to |score-width=40. Provided for compatibility. IgnoRed if score-width is set.

==Script error: No such module "ustring".templateScript error: No such module "ustring".==

template
Set |template=yes if used to create a template for a specific game (add V.T.E. link using {{Navbar}}).

==Script error: No such module "ustring".Undocumented featuresScript error: No such module "ustring".==

Undocumented features
Alas {{enUici|User:Codehydro|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:

{{enUici|Special:PrefixIndex/Module talk:RoundN/testcases|Special:PrefixIndex/Module talk:RoundN/testcases]]