Модуль: Infobox: различия между версиями 🔗


Материал из VEDA Wiki
Перейти к: навигация, поиск
Нет описания правки
Нет описания правки
Строка 15: Строка 15:
   --table.insert(t, ")")
   --table.insert(t, ")")
   local out = table.concat(t, listitem)
   local out = table.concat(t, listitem)
   if frame.args['listitem'] == '' then
   if listitem == '; ' then
     out = "(" .. out
     out = "(" .. out
     out = out .. ")"
     out = out .. ")"

Версия от 17:51, 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 listitem == '; ' then
    out = "(" .. out
    out = out .. ")"
  end
  return out
end

return p