Module:Debug/track

From The Languages of David J. Peterson
Revision as of 05:21, 10 April 2022 by Juelos (talk | contribs) (Created page with "return function (key) local frame = mw.getCurrentFrame() if key then if type(key) ~= "table" then key = { key } end for i, value in pairs(key) do pcall(frame....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Debug/track/documentation

return function (key)
	local frame = mw.getCurrentFrame()
	if key then
		if type(key) ~= "table" then
			key = { key }
		end
		
		for i, value in pairs(key) do
			pcall(frame.expandTemplate, frame, { title = 'tracking/' .. value })
		end
	else
		error('No tracking key supplied to the function "' .. track .. '".')
	end
end