Модуль:Сущность: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 37: | Строка 37: | ||
local function makeSourceLink(s) | local function makeSourceLink(s) | ||
local className = s.name | local className = s.name .. (s.kind and (s.kind:sub(1, 1):upper() .. s.kind:sub(2)) or "") | ||
local tplLabel = "Template:" .. s.tplPath | local tplLabel = "Template:" .. s.tplPath | ||
return "[[" .. tplLabel .. "|" .. className .. "]]" | return "[[" .. tplLabel .. "|" .. className .. "]]" | ||
| Строка 150: | Строка 149: | ||
local content = load_template_content(tplPath) | local content = load_template_content(tplPath) | ||
if not content then | if not content then | ||
local classType = (kind | local classType = (s.kind and (s.kind:sub(1, 1):upper() .. s.kind:sub(2)) or "") | ||
local className = name .. classType | local className = name .. classType | ||
local tplLabel = "Template:" .. tplPath | local tplLabel = "Template:" .. tplPath | ||
| Строка 232: | Строка 231: | ||
local entry = { | local entry = { | ||
tpl = tplStr, | tpl = tplStr, | ||
source = { kind = " | source = { kind = "", name = tplPath, pathName = tplPath, tplPath = tplPath }, | ||
priority = 1, | priority = 1, | ||
idx = #switchKeyToTemplates[sw][key] + 1 | idx = #switchKeyToTemplates[sw][key] + 1 | ||