K wobsahej skočić

Modul:anchor

z Wikisłownika

Dokumentacija za tutón modul hodźi so na Modul:anchor/dokumentacija wutworić

local html_create = mw.html.create
local process_params = require("Modul:parameters").process
local tostring = tostring

local export = {}

function export.main(frame)
	local args = process_params(frame:getParent().args, {
		{required = true, list = true},
	})[1]
	
	local anchors = html_create()
	for i = 1, #args do
		anchors = anchors:tag("span")
			:addClass("template-anchor")
			:attr("id", args[i])
			:done()
	end
	
	return tostring(anchors)
end

return export