FANDOM


return {
	create = function(frame)
		local message = frame:preprocess(frame.args[1])
		local notice_type = frame.args[2] and frame.args[2]:lower()
 
		if message ~= '{{{1}}}' then
			local notice = mw.html.create('div')
				:addClass('notice')
				:css('background-color', frame.args[3])
				:wikitext(message)
 
			if notice_type == '{{{2}}}' then
			    -- Do nothing, use default class "notice"
			elseif notice_type == 'spoiler' then
				notice:addClass('spoiler')
			elseif notice_type == 'disambig' then
				notice:addClass('disambig')
			elseif notice_type == 'stub' then
				notice:addClass('stub')
			elseif notice_type == 'maintenance' then
				notice:addClass('maintenance')
			elseif notice_type == 'informational' then
				notice:addClass('informational')
			else
				return error("Invalid notice type. Try 'spoiler', 'disambig', 'stub', 'maintenance' or 'informational'")
			end
 
			return tostring(notice)
		else
			return error("The notice must contain a message")
		end
	end
}
Community content is available under CC-BY-SA unless otherwise noted.