Module:Mainonly

From 2b2t Wiki
Jump to navigation Jump to search

Documentation for this module may be created at Module:Mainonly/doc

local p = {}

function p.main(frame)
	local ret = frame:getParent().args[1] or ''
	return p._main(ret)
end

function p._main(text)
	if mw.title.getCurrentTitle().namespace == 0 then
		return text
	else
		return ''
	end
end

function p.on_main()
	return mw.title.getCurrentTitle().namespace == 0
end

return p