Автомобильные номера Чехии

Материал из Энциклопедия автомобильных номеров мира
Версия от 23:13, 5 мая 2019; />Сидик из ПТУ (+ |empty_list_message= — кастомное сообщение об ошибке)
Перейти к навигации Перейти к поиску

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

local p = {}
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')

function p.get_list(frame)
	local args = getArgs(frame)
	local elements = {}
	local i = 1
	while args[i] do
		local title = args[i]
		local code = args[i + 1]
		
		if code then
			code = frame:expandTemplate{
				title = 'АТХ',
				args = {code}
			}
			if yesno(args.brackets) then
				code = string.format('(%s)', code)
			end
			if yesno(args.small) then
				code = string.format('<small>%s</small>', code)
			end
			elements[#elements + 1] = string.format('\n* %s %s', title, code)
		else 
			elements[#elements + 1] = ''
		end
		i = i + 2
	end
	return table.concat(elements)
end

return p