Module:Delete

local p = {}

local utilsPage = require("Module:UtilsPage")

function p.Categories(frame) local categories = "" local title = mw.title.getCurrentTitle local namespace = title.nsText if frame:getParent.args[3] == "nocat" then return "" end -- While this could be refactored, it's best that the prefixed category title -- remain whole so that it can be more easily found in source searches if namespace == "File" then categories = categories .. ""		if p.isReady(title) then categories = categories .. ""		end elseif namespace == "Template" then categories = categories .. ""	else categories = categories .. ""	end return categories end

function p.isReady(title) local pagesUsingFile = utilsPage.dpl({		imageused = title.text	}) local file = title.file return #pagesUsingFile == 0 and (false		or file.exists == false		or file.mimeType ~= "image/png"	) end

return p