Moduł:Drzewa link: Różnice pomiędzy wersjami

Z Nonsensopedii, polskiej encyklopedii humoru
M
M (?)
Linia 11: Linia 11:
if args[space] ~= nil then
if args[space] ~= nil then
return args[space]
return args[space]
else end
else return 'cokolwiek a nie znowu ten nil' .. tostring(args)
end
end
end
return namespace or cat
return namespace or cat

Wersja z 09:51, 2 gru 2020


local p = {}
local tools = require('Moduł:Narzędzia')

function p.linkCat(frame)
	local namespaces = 
	{['główna']='główna', ['grafiki']='grafiki', ['nonnews']='nonnews', 
	 ['słownik']='cytaty', ['cytaty']='cytaty', ['poradniki']='poradniki', 
	 ['nonźródła']='nonźródła'}
	local args = tools.getArgs(frame)
	for name, space in pairs(namespaces) do
		if args[space] ~= nil then 
			return args[space] 
		else end
	end
	return namespace or cat
end

return p