Difference between revisions of "Module:List of countries"
MyWikiBiz, Author Your Legacy — Sunday September 07, 2025
Jump to navigationJump to search (Pywikibot 6.4.0) |
(No difference)
|
Latest revision as of 23:32, 15 July 2021
Template:Module rating This module reads a list of ISO 3-letter codes from an article page prefixed by Template:Mono. It centralises the base list of countries in articles of the type Template:Mono in the Template:Mono list articles.
Usage
The module is accessed through the template with the same name:
local debug = false --local get = require('Module:Transcluder').get local p = {} function p.ISO(frame) local source = mw.title.new('List of countries in '..frame.args[1]):getContent() if source then local codes = '' for code in string.gmatch(source, '%u%u%u') do codes = codes..'%|'..code end if debug then return 'List of countries in '..frame.args[1] else return codes end end end return p