(새 문서: -- {{anchor}}에 쓰이는 모듈입니다. local getArgs = require('모듈:Arguments').getArgs local tableTools = require('모듈:TableTools') local p = {} function p.main(frame)...) |
편집 요약 없음 태그: 삭제/특정판 삭제가 요청 혹은 제안된 문서. |
||
1번째 줄: | 1번째 줄: | ||
-- {{anchor}}에 쓰이는 모듈입니다. | -- {{anchor}}에 쓰이는 모듈입니다. {{ㅅ|미사용}} | ||
local getArgs = require('모듈:Arguments').getArgs | local getArgs = require('모듈:Arguments').getArgs |
2022년 6월 24일 (금) 01:02 기준 최신판
이 모듈에 대한 설명문서는 모듈:Anchor/설명문서에서 만들 수 있습니다
-- {{anchor}}에 쓰이는 모듈입니다. {{ㅅ|미사용}}
local getArgs = require('모듈:Arguments').getArgs
local tableTools = require('모듈: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 id="' .. anchor .. '"></span>'
end
return table.concat(ret)
end
return p