This module is used by the templates {{label}}
/{{lb}}
and {{term label}}
/{{tlb}}
to show context labels for definitions.
local export = {}
local labels_module = "Module:labels"
-- Add tracking category for PAGE. The tracking category linked to is ].
local function track(page)
require("Module:debug/track")("labels/" .. page)
end
function export.show(frame)
local parent_args = frame:getParent().args
local compat = (frame.args or "") ~= "" and parent_args
local term_mode = (frame.args or "") ~= ""
local params = {
= {required = true, type = "language", default = "und"},
= {required = true, list = true, default = "example"},
= {type = "boolean"},
= {},
}
if compat then
params = params
params = params
params = nil
end
local args = require("Module:parameters").process(parent_args, params)
-- Gather parameters
local lang = args
local labels = args
-- Temporary tracking for the weird arguments.
if (args.sort) then
track("sort")
end
return require(labels_module).show_labels {
lang = lang,
labels = labels,
sort = args.sort,
nocat = args.nocat,
mode = term_mode and "term-label" or nil,
ok_to_destructively_modify = true,
}
end
return export