Модуль: Infobox: различия между версиями 🔗
Материал из VEDA Wiki
Sphynkx (обсуждение | вклад) Нет описания правки |
Sphynkx (обсуждение | вклад) Нет описания правки |
||
Строка 25: | Строка 25: | ||
function p.event_members( frame ) | function p.event_members( frame ) | ||
local name = frame.args[1] | local name = frame.args[1] | ||
for i in string.gmatch(name, "[^;] | for i in string.gmatch(name, "[^;]*") do | ||
table.insert(t, "[[" .. i .. "]]") | table.insert(t, "[[" .. i .. "]]") | ||
end | end |
Версия от 17:19, 1 октября 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 listitem == '; ' then
out = "(" .. out
out = out .. ")"
end
return out
end
function p.event_members( frame )
local name = frame.args[1]
for i in string.gmatch(name, "[^;]*") do
table.insert(t, "[[" .. i .. "]]")
end
return name
end
return p