Модуль:Тест

Материал из Posmotrelisu
Версия от 15:06, 11 февраля 2025; ЗаяцВолк (обсуждение | вклад)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к навигации Перейти к поиску

Для документации этого модуля может быть создана страница Модуль:Тест/doc

local p = {}

p.sortlist = function (frame)
local args = require('Module:Arguments').getArgs(frame)

local otstup= ' • '
local list_end= ' … '

if args['отступ'] ~= nil then otstup=args['отступ'] end

local res_t = {}
local res=""

for i in ipairs(args) do
table.insert (res_t, args[i])
end

table.sort (
res_t,
function (a, b) return a < b end
)

for i in ipairs(res_t) do
res=res..res_t[i]..otstup
end

return res..list_end
end

return p