Module:Demo: Difference between revisions

From RuneRealm Wiki
Jump to navigation Jump to search
Content added Content deleted
(Created page with "--<nowiki> local T = require("Module:T")._main local p = {} function p.f(frame) local args = frame:getParent().args local template = args[1] local _args = {} for k, v in pairs(args) do if type(k) == "number" then if k ~= 1 then _args[k - 1] = v end else _args[k] = v end end return '<span class="plainlinks">' .. T(args) .. " produces<br>" .. frame:expandTemplate({ title = template, args = _args }) .. '</span>' end return p --</nowiki>")
 
(No difference)

Latest revision as of 22:48, 11 October 2024

Module documentation
This documentation is transcluded from Template:No documentation/doc. [edit] [history] [purge]
This module does not have any documentation. Please consider adding documentation at Module:Demo/doc. [edit]
Module:Demo requires Module:T.

--<nowiki>
local T = require("Module:T")._main

local p = {}

function p.f(frame)
	local args = frame:getParent().args
	local template = args[1]
	local _args = {}
	for k, v in pairs(args) do
		if type(k) == "number" then
			if k ~= 1 then
				_args[k - 1] = v
			end
		else
			_args[k] = v
		end
	end
	return '<span class="plainlinks">' .. T(args) .. " produces<br>" .. frame:expandTemplate({ title = template, args = _args }) .. '</span>'
end

return p
--</nowiki>