Module:Title: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
local args = require("Module:Arguments").getArgs(frame) |
local args = require("Module:Arguments").getArgs(frame) |
||
local title = (args[1] and mw.title.new(args[1])) or (args.title and mw.title.new(args.title)) or currentTitle |
local title = (args[1] and mw.title.new(args[1])) or (args.title and mw.title.new(args.title)) or currentTitle |
||
return title[k] |
return args[title[k]] or title[k] |
||
end |
end |
||
end |
end |
Revision as of 19:47, 22 August 2024
local p = {}
local currentTitle = mw.title.getCurrentTitle()
for k,_ in pairs(currentTitle) do
p[k] = function(frame)
local args = require("Module:Arguments").getArgs(frame)
local title = (args[1] and mw.title.new(args[1])) or (args.title and mw.title.new(args.title)) or currentTitle
return args[title[k]] or title[k]
end
end
return p