Jump to content

Module:Parameter validation/default config: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Changed protection level for "Module:Parameter validation/default config": Highly visible template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
rm userspace, limit categorisation to mainspace
Line 1: Line 1:
function create(cat, msg)
function create(cat, msg)
return mw.ustring.format("[[Category:Pages using tname_naked with %s parameters]]", cat) .. create_message(msg)
return mw.ustring.format("{{main other|[[Category:Pages using tname_naked with %s parameters]]}}", cat) .. create_message(msg)
end
end


Line 16: Line 16:
local result = {
local result = {
[0] = options,
[0] = options,
[2] = options,
--[2] = options,
[4] = options,
[4] = options,
[6] = options,
[6] = options,

Revision as of 15:00, 23 October 2020

function create(cat, msg) 
	return mw.ustring.format("{{main other|[[Category:Pages using tname_naked with %s parameters]]}}", cat) .. create_message(msg)
end

function create_message(msg) 
	return mw.ustring.format("<div class=\"hatnote\" style=\"color:red\"><strong>Warning:</strong> [[templatename]] used with %s (this message is shown only in preview).</div>", msg)
end

local options = {
	["undeclared"] = create("unknown", 'unknown parameters: paramname'),
	["deprecated"] = create("deprecated", 'deprecated parameters: paramname'),
	["duplicate"] = create("duplicate", 'duplicate parameters: paramname'),
	["doc-subpage"] = "doc",
}

local result = {
	[0] = options,
	--[2] = options,
	[4] = options,
	[6] = options,
	--[10] = options,
	[12] = options,
	[14] = options,
}
return result