Module:Capiunto Infobox

local p={}

function p.infobox (frame) local capiunto=require "capiunto" local infobox=capiunto.create({  top = frame.args.title,   topStyle = "background:#C0C0FF"   }) local imageSize=frame.args.imageSize if imageSize==nil then imageSize="" end local caption=frame.args.caption if caption==nil then caption="" end if frame.args.image~=nil and frame.args.image~="" then infobox:addImage("" .. imageSize .. "px|" .. caption .. "") end local i=1 while true do      local arg=frame.args[i] if arg==nil or arg=="" then break end if string.sub(arg,1,7)=="header:" then infobox:addHeader(string.sub(arg,8)) elseif string.sub(arg,1,4)=="row:" then local sep=string.find(arg,":",5) if sep~=nil then infobox:addRow(string.sub(arg,5,sep-1),string.sub(arg,sep+1)) end elseif string.sub(arg,1,8)=="faction:" then local sep=string.find(arg,";",9) if sep~=nil then infobox:addWikitext("{|style=\"width:100%; table-layout:fixed; text-align:left;\"\n|style=\"border-right:1px dashed grey; width:50%;\"|\n" .. string.sub(arg,9,sep-1) .. "\n|\n" .. string.sub(arg,sep+1) .. "\n|}") end end i=i+1 end return infobox end

return p