FANDOM


-- <nowiki>
-- Helps [[RuneScape:Lua/Helper modules]] format its table with dynamic documentation
-- See [[Template:Helper module]] for documentation and usage
local p = {}
 
function p.main(frame)
	local args = frame:getParent().args
	local function_list = {}
	-- Let there be no limit to number of parameters
	local i = 1
	while args['fname'..i] do
		local funcname = args['fname'..i] or ''
		local functype = args['ftype'..i] or ''
		local funcuse = args['fuse'..i] or ''
		function_list[i] = {
				fname = funcname,
				ftype = functype,
				fdesc = funcuse
		}
		i = i + 1
	end
	return p._main(args.name,function_list)
end
 
function p._main(modn,func_list)
	local ret_row = mw.html.create('tr')
				:tag('td')
					-- Name will group together with all functions once
					:attr('rowspan',#func_list)
					:wikitext('[[Module:'..modn..'|'..modn..']]')
				:done()
				:tag('td')
					:tag('code')
						:wikitext(func_list[1].fname)
					:done()
				:done()
				:tag('td')
					:wikitext(func_list[1].ftype)
				:done()
				:tag('td')
					:wikitext(func_list[1].fdesc)
				:done()
			:done()
	local ret = tostring(ret_row)
	for i=2,#func_list,1 do
		local next_row = mw.html.create('tr')
				:tag('td')
					:tag('code')
						:wikitext(func_list[i].fname)
					:done()
				:done()
				:tag('td')
					:wikitext(func_list[i].ftype)
				:done()
				:tag('td')
					:wikitext(func_list[i].fdesc)
				:done()
			:done()
		ret = ret..tostring(next_row)
	end
	return ret
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.