Module:Navbox

-- local p = {} local base = "Module:Navbox/" local suffix local source

function parseData(name, parse) source = base..name local data = mw.loadData(source) if (type(parse) == "function") then return parse(data) else return "" end end

function p.element(frame) return parseData("element", function(data)       local elemType = frame.args["element-type"]        if (data[elemType] == nil) then            elemType = "void"        end        local d = data[elemType] or {}        local title = d.title or ""        local content = frame:expandTemplate{            title = "Elements", args = { d.elemType }        }        local a = {}        a["theme"] = d.elemType or ""        a["title"] = title        a["content"] = content        local html = frame:expandTemplate{            title = "Navbox", args = a        }        return html    end) end

return p