Module:R:roa:AIS

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This module implements the reference template {{R:roa:AIS}}.


local export = {}

function export.main(frame)
	
	local args = require("Module:parameters").process(frame:getParent().args, {
		[1] = {list = true, required = true},
		["place"] = {list = true, allow_holes = true},
		["zoom"] = {list = true, allow_holes = true},
	})

	local ret = "AIS: <cite>Sprach- und Sachatlas Italiens und der Südschweiz</cite> – "

	for index, map in ipairs(args[1]) do
		if index ~= 1 then
			ret = ret .. ", "
		end
		ret = ret .. "[http://navigais-web.pd.istc.cnr.it?map=" .. map
		if args.place[index] then
			ret = ret .. "&point=" .. args.place[index]
			if args.zoom[index] then
				ret = ret .. "&zoom=" .. args.zoom[index]
			end
		end
		ret = ret .. " map " .. map .. "]"
	end

	ret = ret .. " – on <cite>navigais-web.pd.istc.cnr.it</cite>"

	return ret

end

return export