ഘടകം:Anchor

Schoolwiki സംരംഭത്തിൽ നിന്ന്
12:47, 2 ജനുവരി 2021-നു ഉണ്ടായിരുന്ന രൂപം സൃഷ്ടിച്ചത്:- Ranjithsiji (സംവാദം | സംഭാവനകൾ) (ഒരു പതിപ്പ് ഇറക്കുമതി ചെയ്തു: import user link template)
(മാറ്റം) ←പഴയ രൂപം | ഇപ്പോഴുള്ള രൂപം (മാറ്റം) | പുതിയ രൂപം→ (മാറ്റം)

ഈ ഘടകത്തിന്റെ വിവരണം ഘടകം:Anchor/വിവരണം എന്ന താളിൽ നിർമ്മിക്കാവുന്നതാണ്

-- This module implements {{anchor}}.

local getArgs = require('Module:Arguments').getArgs
local tableTools = require('Module:TableTools')

local p = {}

function p.main(frame)
	-- Get the positional arguments from #invoke, remove any nil values,
	-- and pass them to p._main.
	local args = getArgs(frame)
	local argArray = tableTools.compressSparseArray(args)
	return p._main(unpack(argArray))
end

function p._main(...)
	-- Generate the list of anchors.
	local anchors = {...}
	local ret = {}
	for _, anchor in ipairs(anchors) do
		ret[#ret + 1] = '<span class="anchor" id="' .. anchor .. '"></span>'
	end
	return table.concat(ret)
end

return p
"https://schoolwiki.in/index.php?title=ഘടകം:Anchor&oldid=1068503" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്