Configuration for Module:Lua banner
Documentation
Package items
config["subpage_blacklist"](member • table)- Subpage blacklist: these subpages will not be categorized (except for the error category, which is always added if there is an error). For example “Template:Foo/doc” matches the
doc = truerule, so it will have no categories. “Template:Foo” and “Template:Foo/documentation” match no rules, so they will have categories. - All rules should be in the
["<subpage name>"] = true,format. - Field:
...(boolean; optional) config["error_category"](member • string|nil)- Default category: this category is added if the module call contains errors (e. g. no module listed).
- A category name without namespace, or
nilto disable categorization (not recommended). config["default_category"](member • string|nil)- Default category: this category is added if none of the below
module_categoriesmatches the first module listed. A category name without namespace, ornilto disable categorization. config["module_categories"](member • table)- Module categories: one of these categories is added if the first listed module is the listed module (e. g.
{{Lua|Module:String}}adds Category:Lua String-based templates.) - Format:
["<module name>"] = "<category name>", where neither<module name>nor<category name>contains the namespace. - An empty table (i.e. no module-based categorization) will suffice on smaller wikis.
- Field:
...(string; optional) config["allow_wishes"](member • boolean)- Allow wishes: whether wishes for conversion to Lua are allowed for non-
"Scribunto"content models. Iftrue, calls with zero parameters are valid, and considered to be wishes: The box’s text is “This template should use Lua”, andcfg['wish_category']is added. - If
falseor the content model is"Scribunto", such calls are invalid, an error message appears, andcfg['error_category']is added. config["wish_category"](member • string|nil)- Wish category: this category is added if no module is listed, wishes are allowed, and the current content model is not
"Scribunto". (Not used if wishes are not allowed.) - A category name without namespace, or
nilto disable categorization.
See also
--------------------------------------------------------------------------------
-- Configuration for [[Module:Lua banner]]
--
-- @file config
-- @alias cfg
-- @see [[Global Lua Modules/Lua banner]]
--------------------------------------------------------------------------------
local cfg = {};
--[[
-- **Subpage blacklist:** these subpages will not be categorized (except for the
-- error category, which is always added if there is an error).
--
-- For example “Template:Foo/doc” matches the `doc = true` rule, so it will have
-- no categories. “Template:Foo” and “Template:Foo/documentation” match no rules,
-- so they *will* have categories.
--
-- All rules should be in the `["<subpage name>"] = true,` format.
-- @property {table} cfg["subpage_blacklist"]
-- @field[opt] {boolean} ...
--]]
cfg["subpage_blacklist"] = {
["doc"] = true,
["sandbox"] = true,
["sandbox2"] = true,
["testcases"] = true,
};
--[[
-- **Default category:** this category is added if the module call contains errors
-- (e.g. no module listed).
--
-- A category name without namespace, or `nil` to disable categorization (not recommended).
-- @property {string|nil} cfg["error_category"]
--]]
cfg["error_category"] = "Lua templates with errors";
--[[
-- **Default category:** this category is added if none of the below `module_categories`
-- matches the first module listed.
--
-- A category name without namespace, or `nil` to disable categorization.
--
-- @property {string|nil} cfg["default_category"]
--]]
cfg["default_category"] = "Lua-based templates";
---
-- **Module categories:** one of these categories is added if the first listed module
-- is the listed module (e.g. {{T|Lua|"Module:String"}} adds
-- Category:Lua String-based templates.)
--
-- Format: `["<module name>"] = "<category name>"`,
-- where neither `<module name>` nor `<category name>` contains the namespace.
--
-- An empty table (i.e. no module-based categorization) will suffice on smaller wikis.
--
-- @property {table} cfg["module_categories"]
-- @field[opt] {string} ...
cfg["module_categories"] = {
};
--[[
-- **Allow wishes:** whether wishes for conversion to Lua are allowed
-- for non-`"Scribunto"` content models.
--
-- If `true`, calls with zero parameters are valid, and considered to be wishes:
-- The box’s text is “This template should use Lua”, and `cfg['wish_category']`
-- is added.
--
-- If `false` or the content model is `"Scribunto"`, such calls are invalid,
-- an error message appears, and `cfg['error_category']` is added.
--
-- @property {boolean} cfg["allow_wishes"]
--]]
cfg["allow_wishes"] = false;
--[[
-- **Wish category:** this category is added if no module is listed, wishes are allowed,
-- and the current content model is not `"Scribunto"`. (Not used if wishes are not allowed.)
--
-- A category name without namespace, or `nil` to disable categorization.
-- @property {string|nil} cfg["wish_category"]
--]]
cfg["wish_category"] = nil;
return cfg;