Module:Color: Difference between revisions
Jump to navigation
Jump to search
refine deprecation
PhantomCaleb (talk | contribs) (add section links to full list) |
PhantomCaleb (talk | contribs) (refine deprecation) |
||
Line 51: | Line 51: | ||
local result = tostring(html) | local result = tostring(html) | ||
if colorData.deprecated then | if colorData.deprecated then | ||
local action = "" | |||
if type(colorData.deprecated) == "string" then | |||
action = string.format("Use <code>%s</code> instead.", colorData.deprecated) | |||
else | |||
action = "See [[Template:Color]] for a list of supported colors." | |||
end | |||
utilsError.warn(string.format("Color <code>%s</code> is being discontinued. %s", colorId, action)) | |||
result = result.."[["..CAT_DEPRECATED_COLORS.."]]" | result = result.."[["..CAT_DEPRECATED_COLORS.."]]" | ||
end | end | ||
Line 145: | Line 151: | ||
{"invalid color", "foo"}, | {"invalid color", "foo"}, | ||
{"deprecated color", "bar"}, | {"deprecated color", "bar"}, | ||
{"replaced color", "bar"}, | |||
} | } | ||
}, | }, | ||
Line 197: | Line 204: | ||
{ | { | ||
name = "deprecated", | name = "deprecated", | ||
type = " | type = "string", | ||
desc = " | desc = "The name of the color that should be used instead of this color going forward. If multiple colors apply, just put <code>true</code>. Pages using the deprecated color are added to [[:"..CAT_DEPRECATED_COLORS.."]]." | ||
} | } | ||
} | } |