<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AHelper_module</id>
	<title>Module:Helper module - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AHelper_module"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Helper_module&amp;action=history"/>
	<updated>2026-06-15T13:20:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.runerealm.org/index.php?title=Module:Helper_module&amp;diff=33892&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;-- Helps RuneScape:Lua/Helper modules format its table with dynamic documentation -- See Template:Helper module for documentation and usage require(&#039;Module:Mw.html extension&#039;) 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[&#039;fname&#039;..i] do 		local funcname = args[&#039;fname&#039;..i] or &#039;&#039; 		local functype = args[&#039;ftype&#039;..i] or &#039;&#039; 		local funcuse =...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Helper_module&amp;diff=33892&amp;oldid=prev"/>
		<updated>2024-10-15T13:48:40Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- Helps &lt;a href=&quot;/w/RuneScape:Lua/Helper_modules&quot; title=&quot;RuneScape:Lua/Helper modules&quot;&gt;RuneScape:Lua/Helper modules&lt;/a&gt; format its table with dynamic documentation -- See &lt;a href=&quot;/w/Template:Helper_module&quot; title=&quot;Template:Helper module&quot;&gt;Template:Helper module&lt;/a&gt; for documentation and usage require(&amp;#039;Module:Mw.html extension&amp;#039;) 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[&amp;#039;fname&amp;#039;..i] do 		local funcname = args[&amp;#039;fname&amp;#039;..i] or &amp;#039;&amp;#039; 		local functype = args[&amp;#039;ftype&amp;#039;..i] or &amp;#039;&amp;#039; 		local funcuse =...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Helps [[RuneScape:Lua/Helper modules]] format its table with dynamic documentation&lt;br /&gt;
-- See [[Template:Helper module]] for documentation and usage&lt;br /&gt;
require(&amp;#039;Module:Mw.html extension&amp;#039;)&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = frame:getParent().args&lt;br /&gt;
	local function_list = {}&lt;br /&gt;
	-- Let there be no limit to number of parameters&lt;br /&gt;
	local i = 1&lt;br /&gt;
	while args[&amp;#039;fname&amp;#039;..i] do&lt;br /&gt;
		local funcname = args[&amp;#039;fname&amp;#039;..i] or &amp;#039;&amp;#039;&lt;br /&gt;
		local functype = args[&amp;#039;ftype&amp;#039;..i] or &amp;#039;&amp;#039;&lt;br /&gt;
		local funcuse = args[&amp;#039;fuse&amp;#039;..i] or &amp;#039;&amp;#039;&lt;br /&gt;
		function_list[i] = {&lt;br /&gt;
			fname = funcname,&lt;br /&gt;
			ftype = functype,&lt;br /&gt;
			fdesc = funcuse&lt;br /&gt;
		}&lt;br /&gt;
		i = i + 1&lt;br /&gt;
	end&lt;br /&gt;
	local title = mw.title.getCurrentTitle()&lt;br /&gt;
	if title.namespace == 828 and (title.text == args.name or title.text == args.name..&amp;#039;/doc&amp;#039;) then&lt;br /&gt;
		local t = mw.html.create(&amp;#039;table&amp;#039;)&lt;br /&gt;
		t	:addClass(&amp;#039;wikitable&amp;#039;)&lt;br /&gt;
			:tr()&lt;br /&gt;
				:th(&amp;#039;Function&amp;#039;)&lt;br /&gt;
				:th(&amp;#039;Type&amp;#039;)&lt;br /&gt;
				:th(&amp;#039;Use&amp;#039;)&lt;br /&gt;
			:done()&lt;br /&gt;
			:node(p._main(args.name, function_list, nil, false))&lt;br /&gt;
&lt;br /&gt;
		local category = &amp;#039;&amp;#039;&lt;br /&gt;
		if not (title.isSubpage and title.subpageText == &amp;#039;doc&amp;#039;) then&lt;br /&gt;
			category = &amp;#039;[[Category:Helper modules]][[Category:Modules required by modules]]&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		local reqby = &amp;#039;&amp;#039;&lt;br /&gt;
		if not (title.isSubpage and title.subpageText == &amp;#039;doc&amp;#039;) then&lt;br /&gt;
			local uri = mw.uri.canonicalUrl(&amp;#039;Special:WhatLinksHere&amp;#039;, &amp;#039;target=Module:&amp;#039;..args.name..&amp;#039;&amp;amp;namespace=828&amp;#039;)&lt;br /&gt;
			reqby = &amp;#039;For a full list of modules using this helper &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[&amp;#039; .. tostring(uri) .. &amp;#039; click here]&amp;lt;/span&amp;gt;\n&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		local example = &amp;#039;&amp;#039;&lt;br /&gt;
		if args.example then&lt;br /&gt;
			example = &amp;quot;&amp;#039;&amp;#039;&amp;#039;Example:&amp;#039;&amp;#039;&amp;#039;\n&amp;quot; .. args.example&lt;br /&gt;
		end&lt;br /&gt;
		return &amp;#039;This module is a helper module to be used by other modules; it may not designed to be invoked directly. See [[RuneScape:Lua/Helper modules]] for a full list and more information.\n&amp;#039; .. reqby .. tostring(t) .. example .. category&lt;br /&gt;
	else&lt;br /&gt;
		return p._main(args.name, function_list, args.example or &amp;#039;&amp;#039;, true)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function formatFuncNames(list)&lt;br /&gt;
	list = mw.text.split(list or &amp;#039;&amp;#039;, &amp;#039;;;&amp;#039;)&lt;br /&gt;
	local res = {}&lt;br /&gt;
&lt;br /&gt;
	for _, v in ipairs(list) do&lt;br /&gt;
		v = mw.text.trim(v)&lt;br /&gt;
		table.insert(res, string.format(&amp;quot;&amp;lt;code&amp;gt;%s&amp;lt;/code&amp;gt;&amp;quot;, v))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return table.concat(res, &amp;#039;&amp;lt;br&amp;gt;&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(modn, func_list, example, showModuleName)&lt;br /&gt;
	local ret = mw.html.create(&amp;#039;tr&amp;#039;)&lt;br /&gt;
	ret :IF(showModuleName)&lt;br /&gt;
			:td{&amp;#039;[[Module:&amp;#039;..modn..&amp;#039;|&amp;#039;..modn..&amp;#039;]]&amp;#039;, attr={&amp;#039;rowspan&amp;#039;, #func_list}} -- Name will group together with all functions once&lt;br /&gt;
		:END()&lt;br /&gt;
		:td(formatFuncNames(func_list[1].fname))&lt;br /&gt;
		:td(func_list[1].ftype)&lt;br /&gt;
		:td(func_list[1].fdesc)&lt;br /&gt;
&lt;br /&gt;
	for i = 2, #func_list do&lt;br /&gt;
		ret:tr()&lt;br /&gt;
			:td(formatFuncNames(func_list[i].fname))&lt;br /&gt;
			:td(func_list[i].ftype)&lt;br /&gt;
			:td(func_list[i].fdesc)&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>