Module:anchor

विक्षनरी से

"इस मॉड्यूल हेतु प्रलेख Module:anchor/doc पर बनाया जा सकता है"

local m_params = require("Module:parameters")
local m_params_data = mw.loadData("Module:parameters/data").anchor

local export = {}

function export.main(frame)
	local args = m_params.process(frame:getParent().args, m_params_data.main)
	
	local anchors = {}
	for _, arg in ipairs(args[1]) do
		local anchor = mw.html.create("span")
			:addClass("template-anchor")
			:attr("id", arg)
		table.insert(anchors, tostring(anchor))
	end
	
	return table.concat(anchors)
end

return export