Pergi ke kandungan

Modul:Correct typos in one click navigation

Daripada Wikibuku

Pendokumenan untuk modul ini boleh diciptakan di Modul:Correct typos in one click navigation/doc

local p = {}

function p.nav(frame)
	local nav = ''
	local i = 0
	while i < 20 do
		i = i + 1
		local pni = 'Wikibooks:Correct typos in one click/'..i
		local ele = ''
		local ele_grey = '<span style="color:#888">'..i..'</span>'
		local pniTitle = mw.title.new(pni, 4) --project space
		if pniTitle.exists == false then
			ele = ele_grey
		elseif pniTitle.isRedirect then
			ele = ele_grey
		elseif string.len(pniTitle:getContent()) > 5 then
			ele = '[['..pni..'|'..i..']]'
		else
			ele = ele_grey
		end
		nav = nav..ele..', '
	end
	return mw.text.trim( nav, ', ' )
end

return p