Module:WBSC World Rankings/doc

From The Global Wiki
< Module:WBSC World Rankings
Revision as of 02:15, 18 January 2023 by Ofngv (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is the documentation page for Module:WBSC World Rankings

<section begin=Doc />

Usage

This template is meant to help quickly update the WBSC World Rankings for all men's national baseball teams of WBSC, displayed in the infobox on each national team article. When given a country code, the template outputs the WBSC World Ranking of a country, along with a movement indicator (increase, decrease, or steady), and by how many spots a country moves, if applicable. The date of the rankings is also listed, along with a reference to the rankings from WBSC's website.

If desired, the WBSC ranking reference can be used elsewhere in the article using the name "WBSC World Rankings" (i.e. <ref name="WBSC World Rankings"/>).

Parameters

  • 1 (unnamed): WBSC country code
  • mdy: Switches dates to month-day-year format

Example

An example of the code used to display the ranking of File:Flag of Honduras.svg Honduras:

{{WBSC World Rankings|HON}}

This code produces the following:

52 Decrease 3 (31 December 2022)[1]

  1. "The WBSC World Ranking". WBSC. 31 December 2022. Retrieved 31 December 2022.

Updating

The main template page is not meant to be updated. The rankings should be updated at Module:SportsRankings/data/WBSC World Rankings. To update the template, first update the day and month (along with the year if necessary) to the date of the current WBSC World Rankings. Then add a country's new position, along with how many spots they moved (e.g. 2 for increase of two positions, 0 for no movement, -5 for decrease of two positions).

All positions can be quickly updated using a spreadsheet. For example, after copying the entire table from WBSC's ranking list, the following formula can be used in an external spreadsheet to generate the code necessary to update the data page (given the WBSC rankings begin in cell A1):

="| {{subst:str sub old|"&B1&"|0|3}} = "&A1&" | {{subst:str sub old|"&B1&"|0|3}}_move = "&E1

The code generated can be saved on the data page, and the rankings will be updated. Once the cache of a national team page is purged, the updated ranking will be displayed.<section end=Doc />