Module:IBox

local p = {} local yn = require('Module:Yesno')

-- Generates a single row function p.row(frame) local args = frame:getParent.args if args.condition ==  then return  end local tr	if args.class then tr = '' else tr = " " end local th = mw.html.create('th'):wikitext(args[1]) if args.labelclass then th:addClass(args.labelclass) end local td = mw.html.create('td'):wikitext(args[2] or args.default) if args.valueclass then td:addClass(args.valueclass) end return tr..tostring(th)..tostring(td)..' ' end -- Generates a header function p.header(frame) local args = frame:getParent.args if args.condition ==  then return  end local tr = mw.html.create('tr') :tag('th') :attr('colspan', 2):addClass('mainheader') :wikitext(args[1]):done return tostring(tr) end -- Generates the ending part function p.ending(frame) local args = frame:getParent.args if args.mode == 'infotable' then return ' ' else return ' ' end end function p.start(frame) local args = frame:getParent.args local mode = args.mode == 'infotable' and 'infotable' or 'infobox' --CSS computations local css = mode..' box colored bordered innerbordered fill-td type-' if yn(args.type, true) then css = css..mw.text.split(args.type, " ")[1] else css = css..'basic' end if not (args.bullets == 'on') then css = css..' no-icon' end if args.float == 'left' then css = css..' float-left-clear' else css = css..' float-right-clear' end css = css..' '..(args.class or '') --Start the box local page = tostring(mw.title.getCurrentTitle) local text = ' ' return text end return p