Module:Sandbox/Miria~01/sumMedals/doc

Usage
This Lua module is designed to calculate and return the sum of medal values (Gold, Silver, Bronze, or Total) from a specified class within a table on Wikipedia pages. It is particularly useful for automatically updating medal totals in infoboxes and tables.

Syntax:  for information: module name = Sandbox/Miria~01/sumMedals    = pagename of the page module is used (FULLPAGENAME to get full page name) Parameters: Examples: Calculate the total number of Gold medals for "summerMedals" class on the current page: Calculate the total number of Silver medals for "winterMedals" class on a specific page: Calculate the total medal counts for Gold, Silver, Bronze, and Total for "summerMedals" class and return it with four cells (for Gold, Silver, Bronze, and Total) in the last row of the table:
 * `targetClass` (string, required): The class name of the table to be scanned for medal values (e.g., "summerMedals" or "winterMedals").
 * `column` (string, required): The type of medal value to be calculated and returned. Valid options are "Gold," "Silver," "Bronze," "Total," or "All" (for a combined string of all medal types).

Instructions: Infobox Usage: 1. To automatically update infoboxes with medal counts for e.g two targetCalss (like summerMedals or winterMedals), use the module in the infobox template as shown in this example: Table Usage: 2. In your table, ensure that each line starts with the corresponding class attribute (`class="xxx"`) to specify whether it belongs to "summerMedals" or "winterMedalse as shown in this example: Replace `xxx` with the appropriate class name. Note:  If the target class is not found in the table, the module will return 0 for all medal types.