Difference between revisions of "Module:SB Infobox Begin"
Jump to navigation
Jump to search
(Created page with "local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) return p._main(args) end function p._main(args) local...") |
|||
Line 5: | Line 5: | ||
local args = getArgs(frame) | local args = getArgs(frame) | ||
return p._main(args) | return p._main(args) | ||
end | |||
function p.section(frame) | |||
local args = getArgs(frame) | |||
return p._section(args) | |||
end | |||
function p._section(args) | |||
local output = "" | |||
for k,v in pairs(args) do | |||
local newRow = mw.html.create('div') | |||
:addClass('Spaceship-Info-Data-Cell') | |||
newRow:tag('div') | |||
:addClass('Spaceship-Info-Data-Header') | |||
:wikitext(tostring(k)) | |||
newRow:tag('div') | |||
:addClass('Spaceship-Info-Data-Body') | |||
:wikitext(tostring(v)) | |||
output = output .. tostring(newRow) | |||
end | |||
return tostring(output) | |||
end | end | ||
Revision as of 08:46, 17 May 2021
Documentation for this module may be created at Module:SB Infobox Begin/doc
local getArgs = require('Module:Arguments').getArgs
local p = {}
function p.main(frame)
local args = getArgs(frame)
return p._main(args)
end
function p.section(frame)
local args = getArgs(frame)
return p._section(args)
end
function p._section(args)
local output = ""
for k,v in pairs(args) do
local newRow = mw.html.create('div')
:addClass('Spaceship-Info-Data-Cell')
newRow:tag('div')
:addClass('Spaceship-Info-Data-Header')
:wikitext(tostring(k))
newRow:tag('div')
:addClass('Spaceship-Info-Data-Body')
:wikitext(tostring(v))
output = output .. tostring(newRow)
end
return tostring(output)
end
function p._main(args)
local output = ""
for k,v in pairs(args) do
output = output .. tostring(v)
end
return tostring(output)
end
return p