Module:Williek11/Items List

local main = {}

-- Parameters wrap:  1...infinity: rows --

function main.main ( frame ) local args = frame:getParent.args local container = mw.html.create("div") local rows = {} local i = 1 while (args[i]) do		rows[i] = container:tag("div") :cssText("display:flex;justify-content:center;") :wikitext(args[i]) if (args.wrap == "yes" or args.wrap == nil) then rows[i]:css("flex-wrap", "wrap") else rows[i]:css("flex-wrap", "nowrap") end i = i+1 end return container end

-- Parameters margin: - optional 1: wikitext (image) 2: wikitext (caption) - optional --

function main.item ( frame ) local args = frame:getParent.args if (args[2] ~= "") then args[2] = " "..args[2] end local container = mw.html.create("div") :wikitext(args[1]..args[2]) if (args.margin) then container:css("margin", args.margin) else container:css("margin", "10px") end return container end

return main