Модуль:Краткий вызов
Внешний вид
Для документации этого модуля может быть создана страница Модуль:Краткий вызов/doc
p = {}
p.shortcut = function(f)
local args = require("Модуль:ProcessArgs").norm()
local result = mw.html.create("table")
result:addClass("noprint")
result:addClass("shortcut")
result:attr("cellspacing", "0")
local tableRow = result:tag("tr")
local firstCell = tableRow:tag("td")
firstCell:addClass("shortcut-1")
firstCell:wikitext("[[Файл:Redirectltr.png|20px|link=|Короткая ссылка-перенаправление|alt=↱]]")
local secondCell = tableRow:tag("td")
secondCell:addClass("shortcut-2")
local asTemplate = args["шаблон"] or "да"
if (asTemplate == "да") then
for index, value in ipairs(args) do
if index > 1 then
secondCell:tag("br")
end
secondCell:wikitext(f:expandTemplate({
["title"] = "ШаблонСсылка",
["args"] = {
value
}
}))
end
else
for index, value in ipairs(args) do
if index > 1 then
secondCell:tag("br")
end
secondCell:wikitext("[[" .. value .. "]]")
end
end
return tostring(result)
end
return p