Module:Test: Difference between revisions
From Elwiki
(Replaced content with "require('Module:CommonFunctions') require('Module:InfoboxProto'); local getArgs = require('Module:Arguments').getArgs local p = {} -- Main process function p.main(frame) local args = getArgs(frame); local infobox = require('Module:InfoboxProto').main(frame, args.title); local divclass = args.divclass; if divclass == nil then divclass = 'custom' end infobox:addClass('infobox-' .. divclass); local i = 1; for k, v in spairs(args...") Tag: Replaced |
No edit summary Tag: Manual revert |
||
(7 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
infobox:addClass('infobox-' .. divclass); | infobox:addClass('infobox-' .. divclass); | ||
for k, v in spairs(args) do | for k, v in spairs(args) do | ||
if string.match(k, 'data[0-9]+') ~= nil then | if string.match(k, 'data[0-9]+') ~= nil then | ||
local i = k:gsub('data', ''); | |||
addField('data' .. i, args['label' .. i]) | addField('data' .. i, args['label' .. i]) | ||
end | end | ||
end | end |
Latest revision as of 15:22, 17 June 2024
Documentation for this module may be created at Module:Test/doc
require('Module:CommonFunctions')
require('Module:InfoboxProto');
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Main process
function p.main(frame)
local args = getArgs(frame);
local infobox = require('Module:InfoboxProto').main(frame, args.title);
local divclass = args.divclass;
if divclass == nil then
divclass = 'custom'
end
infobox:addClass('infobox-' .. divclass);
for k, v in spairs(args) do
if string.match(k, 'data[0-9]+') ~= nil then
local i = k:gsub('data', '');
addField('data' .. i, args['label' .. i])
end
end
return tostring(infobox);
end
return p