Модуль: Infobox: различия между версиями 🔗
Материал из VEDA Wiki
Sphynkx (обсуждение | вклад) Нет описания правки |
Sphynkx (обсуждение | вклад) Нет описания правки |
||
Строка 4: | Строка 4: | ||
local t = {} | local t = {} | ||
local name = frame.args[1] | local name = frame.args[1] | ||
local listitem = frame.args['listitem'] == 'true' and ' | local listitem = frame.args['listitem'] == 'true' and '<br>' or '; ' -- additional param for items lists | ||
if #name == 0 then | if #name == 0 then | ||
return '' | return '' |
Версия от 17:50, 28 сентября 2024
Для документации этого модуля может быть создана страница Модуль:Infobox/doc
local p = {} -- p stands for package
function p.synonyms( frame )
local t = {}
local name = frame.args[1]
local listitem = frame.args['listitem'] == 'true' and '<br>' or '; ' -- additional param for items lists
if #name == 0 then
return ''
end
for i in string.gmatch(name, "[^;]+") do
table.insert(t, "[[" .. i .. "]]")
end
--table.insert(t, ")")
local out = table.concat(t, listitem)
if frame.args['listitem'] == '' then
out = "(" .. out
out = out .. ")"
end
return out
end
return p