Module:SiteList: Difference between revisions
Jump to navigation
Jump to search
PeaceDeadC (talk | contribs) No edit summary Tag: Reverted |
PeaceDeadC (talk | contribs) No edit summary Tag: Reverted |
||
Line 1: | Line 1: | ||
local p = {} |
local p = {} |
||
local SiteDictionary = require('Module:SiteDictionary') |
|||
local function buildRow(siteType, site, id, sceneid, alias, notes) |
local function buildRow(siteType, site, id, sceneid, alias, notes) |
Revision as of 19:26, 21 July 2023
Documentation for this module may be created at Module:SiteList/doc
local p = {} local SiteDictionary = require('Module:SiteDictionary') local function buildRow(siteType, site, id, sceneid, alias, notes) local siteInfo = SiteDictionary[site] local link if sceneid ~= '' then link = string.format(siteInfo.sceneFormat, sceneid) elseif id ~= '' then link = string.format(siteInfo.idFormat, id) else link = siteInfo.defaultLink end return string.format('|-\n| %s || [ %s %s] || %s || %s || %s\n', siteType, link, siteInfo.name, alias, sceneid, notes) end function p.siteList(frame) local args = frame:getParent().args local siteType = args[1] or 'N/A' local site = args.site or 'N/A' local id = args.id or '' local sceneid = args.sceneid or '' local alias = args.alias or 'N/A' local notes = args.notes or 'N/A' return buildRow(siteType, site, id, sceneid, alias, notes) end return p