Module:Parameter validation/default config

From BusinessCraft Wiki
Revision as of 18:30, 6 May 2021 by wikipedia>Izno (add dependency to if preview)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Parameter validation/default config/doc

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 require('Module:If preview')._warning({
		mw.ustring.format("[[templatename]] used with %s.", msg)
	})
end

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

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