Jump to content

Module:Sandbox/SD0001/Tabbed window: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
WIP not working yet
(No difference)

Revision as of 07:24, 28 January 2025

local Arguments = require('Module:Arguments')

local p = {}

p.main = function(frame)
	return p._main(Arguments.getArgs(frame))
end

p._main = function(args)
	local tabsTable = {}
	for param, value in ipairs(args) do
		if string.match(param, "^tab%d+") ~= nil then
			local num = tonumber(string.match(param, '%d+'))
			if num ~= nil and args['content'..num] ~= nil then
				tabsTable[value] = args['content'..num]
			end
		end
	end
	return tabsTable
end

return p