▶️
Planeshift.
Документацию для этого шаблона или модуля можно найти в Шаблон:Значок.
Вы можете быть перенаправлены на другой язык вики, если перевод недоступен.
Зависимости
local p = {}
local data = mw.loadData('Модуль:Значок/data')
local getArgs = require('Модуль:Arguments').getArgs
local mFileLink = require('Модуль:File link')._main
local i18n = {
error = {
no_data = 'Не найдено данных',
no_input = 'Нет ввода'
}
}
function p.main(frame)
local args = getArgs(frame, {
wrappers = {
'Шаблон:Значок'
}
})
return p._main(args)
end
function p._main(args)
assert(args[1], i18n.error.no_input)
local symbol_data = data[mw.ustring.lower(args[1])]
assert(symbol_data, i18n.error.no_data)
-- If there is not file key, that means that there are different states
-- for this symbol.
if not symbol_data.file then
symbol_data = symbol_data[mw.ustring.lower(args[2] or 'yes')]
end
-- Create a copy of the symbol table to make it editable.
local symbol = {}
for k,v in pairs(symbol_data) do
symbol[k] = v
end
symbol.size = (args.size or symbol.size or '16px')
symbol.alt = args.alt
return mFileLink(symbol)
end
return p