Module:API info/deprecated

From Warcraft Wiki
Jump to navigation Jump to search

Documentation for this module may be created at Module:API info/deprecated/doc

-- https://warcraft.wiki.gg/wiki/Template:Deprecatedapi
local m = {}

local template = {
	title = "Ambox",
	args = {
		border = "yellow",
		type = "''%s was deprecated in <font color=#ecbc2a>%s</font> and will be removed in the next expansion.''",
		image = "[[Image:Spell_holy_borrowedtime.png|32px|link=]]",
		style = "width: auto; margin-left: 0.8em;",
	}
}

local function GetAmbox(f)
	if #f.args.moved > 0 then
		template.args.type = template.args.type:format("<font color=#dda0dd>"..f.args.moved.."</font>", f.args.patch)
	elseif #f.args.note > 0 then
		template.args.type = f.args.note
	else
		template.args.type = template.args.type:format("This function", f.args.patch)
	end
	return f:expandTemplate(template)
end

function m.main(f)
	return GetAmbox(f)
end

return m