Module:Color: Difference between revisions

Jump to navigation Jump to search
refine deprecation
(add section links to full list)
(refine deprecation)
Line 51: Line 51:
local result = tostring(html)
local result = tostring(html)
if colorData.deprecated then
if colorData.deprecated then
utilsError.warn(string.format("Color <code>%s</code> is being discontinued. See [[Template:Color]] for a list of supported colors.", colorId))
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 = "boolean",
type = "string",
desc = "Set this to true for colors that are to be removed or replaced. Pages using this color are added to [[:"..CAT_DEPRECATED_COLORS.."]].<br/>Please indicate in <code>notes</code> what color should be used instead."
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.."]]."
}
}
}
}

Navigation menu