Модул:category tree/topic cat/data
This is the main data module for Module:category tree/topic cat. It does not contain data itself, but rather imports the data from its submodules, and applies some post-processing.
To add a new data submodule, add its name to the subpages
list at the top of the module.
Горња документација је укључена са странице Модул:category tree/topic cat/data/док. (уреди | историја) Уредници могу да експериментишу на подстраницама песак (направи | дуплирај) и тест (направи) овог модула. Подстранице овог модула. |
local labels = {}
local handlers = {}
local subpages = {
"Body",
"Buildings and structures",
"Communication",
"Culture",
"Earth",
"Food and drink",
"History",
"Human",
"Lifeforms",
"Animals",
"Plants",
"Mathematics",
"Miscellaneous",
"Names",
"Nature",
"Numbers",
"People",
"Philosophy",
-- "Places",
"Sciences",
"Sex",
"Social acts",
"Society",
"Sports",
"Technology",
"Time",
"Transport",
}
labels["листа свега"] = {
description = "{{{langname}}} појмови организовани по теми, као за \"Породица\" или \"Хемија\".",
parents = {{module = "poscatboiler", args = {label = "{{{langcat}}}", raw = true, called_from_inside = true}}},
}
labels["листа тема"] = {
description = "Све теме тренутно доступне у {{{langname}}}.",
parents = {{name = "листа свега", sort = " *"}},
}
labels["све теме"] = {
description = "{{{langname}}} термини који припадају скупу ствари, као \"Планете\" или \"Canids\".",
parents = {{module = "poscatboiler", args = {label = "{{{langcat}}}", raw = true, called_from_inside = true}}},
}
labels["листа свих"] = {
description = "Сви скупови тренутно доступне у {{{langname}}}.",
parents = {{name = "све теме", sort = " *"}},
}
for label, data in pairs(labels) do
data.module = "Модул:category tree/topic cat/data"
end
-- Import subpages
for _, subpage in ipairs(subpages) do
local datamodule = "Модул:category tree/topic cat/data/" .. subpage
local retval = require(datamodule)
if not retval["LABELS"] then
retval = {LABELS = retval}
end
for label, data in pairs(retval["LABELS"]) do
if labels[label] and not retval["IGNOREDUP"] then
error("Ознака " .. label .. " дефинисана у оба [["
.. datamodule .. "]] и [[" .. labels[label].module .. "]].")
end
data.module = datamodule
labels[label] = data
end
if retval["HANDLERS"] then
for _, handler in ipairs(retval["HANDLERS"]) do
table.insert(handlers, { module = datamodule, handler = handler })
end
end
end
return {LABELS = labels, HANDLERS = handlers}