Difference between revisions of "Module:Sports table/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>S.A. Julio
(→‎Style: adding)
blackwiki>Gonnym
(doc update)
Line 1: Line 1:
{{module rating|release}}
 
{{module rating|protected}}
 
 
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
 
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
 +
{{High-use|24139}}
 +
{{Module rating|release}}
 +
{{Module rating|protected}}
 +
{{Lua|Module:Arguments|Module:No globals|Module:Sports results|Module:Sports table/sub|Module:Yesno}}
 +
 
This Lua-based module is meant to build group and league tables for sports as well. Note that this module is used extensively, so test potential changes rigorously in the sandbox and please ensure consensus exists before implementing major changes. The rest of this documentation explains how the set-up of the module. Refer to individual style pages for detailed usage instructution
 
This Lua-based module is meant to build group and league tables for sports as well. Note that this module is used extensively, so test potential changes rigorously in the sandbox and please ensure consensus exists before implementing major changes. The rest of this documentation explains how the set-up of the module. Refer to individual style pages for detailed usage instructution
  
Line 11: Line 14:
 
The <code>XXX</code> in <code>style=XXX</code> is to be replaced by one of the following available styles:
 
The <code>XXX</code> in <code>style=XXX</code> is to be replaced by one of the following available styles:
  
; General styles
+
====General styles====
* [[Module:Sports table/WDL|WDL]] (For tables with a win-draw-loss system)
+
* [[Module:Sports table/WDL|WDL]] For tables with a win-draw-loss system
* [[Module:Sports table/WL|WL]] (For tables with a win-loss system)
+
* [[Module:Sports table/WL|WL]] For tables with a win-loss system
* [[Module:Sports table/WL OT|WL OT]] (For tables with a win-loss system that gives different weights to overtime wins)
+
* [[Module:Sports table/WL OT|WL OT]] For tables with a win-loss system that gives different weights to overtime wins
* [[Module:Sports table/WL OTL tiebreak|WL OTL tiebreak]] (For tables with a win-loss-OT loss system and a separate tiebreak column)
+
* [[Module:Sports table/WL OTL tiebreak|WL OTL tiebreak]] For tables with a win-loss-OT loss system and a separate tiebreak column
* [[Module:Sports table/WL goal points]] (For tables with a win-loss system that gives additional points for goals)
+
* [[Module:Sports table/WL goal points|WL goal points]] For tables with a win-loss system that gives additional points for goals
* [[Module:Sports table/WDL OT|WDL OT]] (For tables with a win-loss system which allow draws or overtime wins in certain situations)
+
* [[Module:Sports table/WDL OT|WDL OT]] For tables with a win-loss system which allow draws or overtime wins in certain situations
 
* [[Module:Sports table/RR|Round robin]]
 
* [[Module:Sports table/RR|Round robin]]
  
; Sport or league specific styles
+
====Sport or league specific styles====
* [[Module:Sports table/Volleyball|Volleyball]] (For tables with volleyball system, including sets, setpoints and different points for different types of wins)
+
* [[Module:Sports table/Volleyball|Volleyball]] For tables with volleyball system, including sets, set-points and different points for different types of wins
 
* [[Module:Sports table/Darts|Darts]]
 
* [[Module:Sports table/Darts|Darts]]
 
* [[Module:Sports table/Badminton individual|Badminton individual]]
 
* [[Module:Sports table/Badminton individual|Badminton individual]]
Line 28: Line 31:
 
* Football (soccer) was the first creation. This style is renamed to [[Module:Sports table/WDL|WDL]]
 
* Football (soccer) was the first creation. This style is renamed to [[Module:Sports table/WDL|WDL]]
  
;More styles
+
====More styles====
 
The module uses [[WP:Lua|Lua]] to create the tables. Most functionality is obtained from the main module, but specific column formatting comes from the style sub-modules. The existing styles can handle a lot of different options. In case you need additional options it could be useful to create a new style. Note that some tweaking of an existing style could give you the functionality you need, rather than creating a completely new style. In case you do create a new style, you might want to refer to the [[mw:Extension:Scribunto/Lua reference manual|Lua reference manual]].
 
The module uses [[WP:Lua|Lua]] to create the tables. Most functionality is obtained from the main module, but specific column formatting comes from the style sub-modules. The existing styles can handle a lot of different options. In case you need additional options it could be useful to create a new style. Note that some tweaking of an existing style could give you the functionality you need, rather than creating a completely new style. In case you do create a new style, you might want to refer to the [[mw:Extension:Scribunto/Lua reference manual|Lua reference manual]].
  

Revision as of 20:07, 20 May 2019

This Lua-based module is meant to build group and league tables for sports as well. Note that this module is used extensively, so test potential changes rigorously in the sandbox and please ensure consensus exists before implementing major changes. The rest of this documentation explains how the set-up of the module. Refer to individual style pages for detailed usage instructution

Usage

The basic command is {{#invoke:Sports table|main|style=XXX}}

Style

The XXX in style=XXX is to be replaced by one of the following available styles:

General styles

  • WDL – For tables with a win-draw-loss system
  • WL – For tables with a win-loss system
  • WL OT – For tables with a win-loss system that gives different weights to overtime wins
  • WL OTL tiebreak – For tables with a win-loss-OT loss system and a separate tiebreak column
  • WL goal points – For tables with a win-loss system that gives additional points for goals
  • WDL OT – For tables with a win-loss system which allow draws or overtime wins in certain situations
  • Round robin

Sport or league specific styles

More styles

The module uses Lua to create the tables. Most functionality is obtained from the main module, but specific column formatting comes from the style sub-modules. The existing styles can handle a lot of different options. In case you need additional options it could be useful to create a new style. Note that some tweaking of an existing style could give you the functionality you need, rather than creating a completely new style. In case you do create a new style, you might want to refer to the Lua reference manual.

Other options

Other options can be used, for example: {{#invoke:Sports table|main|style=WL OT |sortable_table = yes |source=ICC |update=July 28, 2018

sortable_table

"yes" makes the table columns sortable

source

Adds a link which should point to a web resource with the information for verifying or updating the table

update

Gives the date when the table info was last updated. This is to be set manually - it's not automatically changed when someone changes the table.