Jump to content

Module:Revisions until removed

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by SilverLocust (talk | contribs) at 07:25, 23 May 2024 (Create module for Template:Revisions until removed. Counts down number of revisions until it is removed (for use with #if: ).). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
local p = {}
local getArgs = require('Module:Arguments').getArgs

function p.main(frame)
	local args = getArgs(frame)
	local num = tonumber(args['1'] or 2)
	num = num - 1
	if num > 0 then
		return '{{subst:revisions until removed|'..tostring(num)..'}}'
	else
		return '<!--{{subst:revisions until removed|'..tostring(num)..'}}-->'
	end
end

return p