RogerDodger (talk | contribs) (mirror matches exist dummy) |
RogerDodger (talk | contribs) (move pageTitle to its own function) |
||
Line 7: | Line 7: | ||
end | end | ||
p. | p.pageTitle = function(p1, p2) | ||
if p1 > p2 then | if p1 > p2 then | ||
p2, p1 = p1, p2 | p2, p1 = p1, p2 | ||
end | end | ||
local pageTitle = p1 .. " vs " .. p2 | local pageTitle = p1 .. " vs " .. p2 | ||
end | |||
p._main = function(p1, p2) | |||
local label = p2 | |||
local class = p2:lower():gsub("%s+","-") | |||
return mw.getCurrentFrame():expandTemplate{ | return mw.getCurrentFrame():expandTemplate{ | ||
title = "CharSelectChar", | title = "CharSelectChar", | ||
args = { label, class, pageTitle } | args = { label, class, p.pageTitle(p1, p2) } | ||
} | } | ||
end | end | ||
return p | return p |
Revision as of 04:53, 2 July 2021
Documentation for this module may be created at Module:Matchup/doc
local p = {};
p.main = function(frame)
local p1 = frame.args[1]
local p2 = frame.args[2]
return p._main(p1, p2)
end
p.pageTitle = function(p1, p2)
if p1 > p2 then
p2, p1 = p1, p2
end
local pageTitle = p1 .. " vs " .. p2
end
p._main = function(p1, p2)
local label = p2
local class = p2:lower():gsub("%s+","-")
return mw.getCurrentFrame():expandTemplate{
title = "CharSelectChar",
args = { label, class, p.pageTitle(p1, p2) }
}
end
return p