Content deleted Content added
test |
sync |
||
Line 1:
-- This module implements {{side box}}.
local yesno = require('Module:Yesno')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
Line 12 ⟶ 16:
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 35 ⟶ 41:
data.image = args.image
end
-- Copy over data that doesn't need adjusting
local argsToCopy = {
Line 55 ⟶ 62:
data[key] = args[key]
end
return data
end
function p.renderSidebox(data)
-- Renders the sidebox HTML.
Line 70 ⟶ 79:
root:cssText(data.style)
end
-- The "above" row
if data.above then
Line 86 ⟶ 96:
:wikitext(data.above)
end
-- The body row
local bodyRow = root:newline():tag('tr'):newline()
Line 106 ⟶ 117:
:wikitext(data.imageright)
end
-- The below row
if data.below then
Line 117 ⟶ 129:
belowCell:wikitext(data.below)
end
return tostring(root)
end
return p
|