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

Материал из Posmotrelisu
Перейти к навигации Перейти к поиску
 
(не показано 97 промежуточных версий этого же участника)
Строка 1: Строка 1:
local p = {};
local p = {}


p.test = function ( frame )
p.sortlist = function (frame)
return "Ad Victoriam!"
local args = require('Module:Arguments').getArgs(frame)
end
 
local otstup= ' • '
local list_end= ' … '
 
if args['отступ'] ~= nil then otstup=args['отступ'] end


p.vkl= function ( frame )
local res_t = {}
local res=""


local h=""
for i in ipairs(args) do
local b=""
table.insert (res_t, args[i])
local i=3
while true do
if frame.args[i] == nil then break end
h=h..frame.args[i]
i=i+2
end
end


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


while true do
for i in ipairs(res_t) do
if frame.args[i] == nil then break end
res=res..res_t[i]..otstup
b=b..frame.args[i]
i=i+2
end
end


return h..b
return res..list_end
 
end
end


return p
return p

Текущая версия на 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