Module:Side box/sandbox: Difference between revisions

Content deleted Content added
test
test
Line 1:
local yesno = require('Module:Yesno')
 
local p = {}
 
function p.main(frame)
local origArgs = frame:getParent().args
Line 14 ⟶ 12:
return p._main(args)
end
 
function p._main(args)
local data = p.makeData(args)
return p.renderSidebox(data)
end
 
function p.makeData(args)
local data = {}
Line 39 ⟶ 35:
data.image = args.image
end
 
-- Copy over data that doesn't need adjusting
local argsToCopy = {
Line 60 ⟶ 55:
data[key] = args[key]
end
 
return data
end
 
function p.renderSidebox(data)
-- Renders the sidebox HTML.
Line 77 ⟶ 70:
root:cssText(data.style)
end
 
-- The "above" row
if data.above then
Line 94 ⟶ 86:
:wikitext(data.above)
end
 
-- The body row
local bodyRow = root:newline():tag('tr'):newline()
Line 115 ⟶ 106:
:wikitext(data.imageright)
end
 
-- The below row
if data.below then
Line 127 ⟶ 117:
belowCell:wikitext(data.below)
end
 
return tostring(root)
end
 
return p