Մոդուլ:Կատեգորիաները միայն հոդվածում

Documentation for this module may be created at Մոդուլ:Կատեգորիաները միայն հոդվածում/doc

local p = {}

function p.main ( frame )
	local s = ""
	local title = mw.title.getCurrentTitle()
	local pargs = frame:getParent().args
	if title and title.namespace == 0 and not pargs["nocat"] then
		local sortKey = title.text:gsub('«', "")
								  :gsub('»', "")
		for i,v in ipairs(pargs) do
			s = s .. "[[Կատեգորիա:" .. v .. "|" .. sortKey .. "]]"
		end
	end
	return s
end

return p