Module:TOC

From ProleWiki, the proletarian encyclopedia
Revision as of 13:42, 22 June 2022 by Forte (talk | contribs) (Very rough sketch of TOC template based on Sidebar code)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
local p = {}
function p.toc( frame )
	local args = frame:getParent().args
	local root = mw.html.create()
	root = root:tag('div')
	root:addClass('template-toc')
	local rowNums = {}
	for k,v in pairs(args) do
		local num = k:match('^heading(%d+)$') or k:match('^content(%d+)$')
		if num then table.insert(rowNums, tonumber(num))
		end
	end
		

end
return p