Module:Editor reflections archive

.mw-parser-output .documentation,.mw-parser-output .documentation-metadata{border:1px solid var(--border-color-base,#a2a9b1);background-color:#ecfcf4;color:inhe

Module:Editor reflections archive
-----------------------------------------------------
-- Archive navigator for Wikipedia:Editor reflections
--        Because of the archive title layout,
--         Module:Archive can't be used here
-----------------------------------------------------

local p = {}

function p.archiveExists( n )
	archivePage = "Wikipedia:Editor reflections/" .. (n+1) .. "–" .. (n+100)
	return mw.title.new(archivePage).exists
end

function p.archiveNumber()
	title = mw.title.getCurrentTitle().text
	mw.log(title)
	number = tonumber(string.match(title, "/(.*)–")) - 1
	return number
end

function p.archiveCount()
	count = 0
	while p.archiveExists(count) do
		count = count + 100
	end
	return count
end

function p.archiveNavLinks()
	number = p.archiveNumber()
	total = p.archiveCount()
	links = "| "
	if number > 0 then
		links = links .. "[[Wikipedia:Editor reflections/1–100]] || ← || "
	end
	if number > 200 then
		links = links .. "[[Wikipedia:Editor reflections/" .. number-199 .. "–" .. number-100 .. "]] || "
	end
	if number > 100 then
		links = links .. "[[Wikipedia:Editor reflections/" .. number-99 .. "–" .. number .. "]] ||"
	end
	links = links .. " [[Wikipedia:Editor reflections/" .. number+1 .. "–" .. number+100 .. "]]"
	if number < total - 200 then
		links = links .. " || [[Wikipedia:Editor reflections/" .. number+101 .. "–" .. number+200 .. "]]"
	end
	if number < total - 300 then
		links = links .. " || [[Wikipedia:Editor reflections/" .. number+201 .. "–" .. number+300 .. "]]"
	end
	if number < total - 100 then
		links = links .. " || → || [[Wikipedia:Editor reflections/" .. total-99 .. "–" .. total .. "]]"
	end
	return links
end

function p.archiveListRecursive( n )
	if p.archiveExists(n) then
		return "* [[Wikipedia:Editor reflections/" .. (n+1) .. "–" .. (n+100) .. "]]\n" .. p.archiveListRecursive(n+100)
	else
		return ""
	end
end

function p.archiveList( frame )
	return p.archiveListRecursive( frame.args[1] )
end

return p

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.