모듈:attention
보이기
이 모듈에 대한 설명문서는 모듈:attention/설명문서에서 만들 수 있습니다
local format_categories = require("Module:utilities").format_categories
local html_create = mw.html.create
local concat = table.concat
local insert = table.insert
local process_params = require("Module:parameters").process
local export = {}
function export.show(frame)
local args = process_params(frame:getParent().args, {
[1] = {required = true},
[2] = true,
["id"] = true,
["sort"] = true,
})
local lang_code = args[1]
local title = args[2]
local id = args["id"] or ""
local lang = require("Module:languages").getByCode(lang_code, 1)
local categories = {format_categories({"Requests for attention concerning " .. lang:getCanonicalName()}, lang)}
if not (title or mw.title.getCurrentTitle().nsText == "Template") then
insert(categories, format_categories({"attention lacking explanation"}, lang, "-"))
end
-- mw.html escapes special characters in the id and title attributes.
local ret = html_create("span")
:addClass("attentionseeking")
:attr("lang", lang_code)
if id ~= "" then
ret = ret:attr("id", "attentionseeking" .. lang_code .. id)
end
if title then
ret = ret:attr("title", title)
end
return tostring(ret) .. concat(categories)
end
return export