Модуль:Сущность: различия между версиями

мНет описания правки
мНет описания правки
Строка 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 "")
        .. (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 == "component" and "Component" or "Prototype")
             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 = "template", name = tplPath, pathName = tplPath, tplPath = tplPath },
                 source = { kind = "", name = tplPath, pathName = tplPath, tplPath = tplPath },
                 priority = 1,
                 priority = 1,
                 idx = #switchKeyToTemplates[sw][key] + 1
                 idx = #switchKeyToTemplates[sw][key] + 1