"ഘടകം:Anchor" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

Schoolwiki സംരംഭത്തിൽ നിന്ന്
(ചെ.) (ഒരു പതിപ്പ് ഇറക്കുമതി ചെയ്തു)
 
mlwiki>Ranjithsiji
(ചെ.) (en:Module:Anchor എന്നതിൽ നിന്ന് ഒരു പതിപ്പ് ഇറക്കുമതി ചെയ്തു)
വരി 19: വരി 19:
local ret = {}
local ret = {}
for _, anchor in ipairs(anchors) do
for _, anchor in ipairs(anchors) do
ret[#ret + 1] = '<span id="' .. anchor .. '"></span>'
ret[#ret + 1] = '<span class="anchor" id="' .. anchor .. '"></span>'
end
end
return table.concat(ret)
return table.concat(ret)

19:05, 31 ഡിസംബർ 2020-നു നിലവിലുണ്ടായിരുന്ന രൂപം

ഈ ഘടകത്തിന്റെ വിവരണം ഘടകം: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=1068502" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്