모듈:Parameter names example 편집하기

귀하는 로그인되어 있지 않습니다. 이대로 편집하면 귀하의 IP 주소가 편집 기록에 남게 됩니다.

편집을 취소할 수 있습니다. 이 편집을 되돌리려면 아래의 바뀐 내용을 확인한 후 게시해주세요.

최신판 당신의 편집
2번째 줄: 2번째 줄:


local p = {}
local p = {}
 
local function makeParam(s)
local function makeParam(s)
local lb = '{'
local lb = '{'
8번째 줄: 8번째 줄:
return lb:rep(3) .. s .. rb:rep(3)
return lb:rep(3) .. s .. rb:rep(3)
end
end
 
local function italicize(s)
local function italicize(s)
return "''" .. s .. "''"
return "''" .. s .. "''"
end
end
 
local function plain(s)
local function plain(s)
return s
return s
end
end
 
function p._main(args, frame)
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
-- Find how we want to format the arguments to the template.
27번째 줄: 27번째 줄:
formatFunc = makeParam
formatFunc = makeParam
end
end
 
-- Build the table of template arguments.
-- Build the table of template arguments.
local targs = {}
local targs = {}
37번째 줄: 37번째 줄:
end
end
end
end
 
-- Find the template name.
-- Find the template name.
local template
local template
50번째 줄: 50번째 줄:
end
end
end
end
 
-- Call the template with the arguments.
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
frame = frame or mw.getCurrentFrame()
64번째 줄: 64번째 줄:
end
end
end
end
 
function p.main(frame)
function p.main(frame)
local args = require('모듈:Arguments').getArgs(frame, {
local args = require('Module:Arguments').getArgs(frame, {
wrappers = ':변수 이름 미리보기'
wrappers = 'Template:Parameter names example'
})
})
return p._main(args, frame)
return p._main(args, frame)
end
end
 
return p
return p
가온 위키에서의 모든 기여는 크리에이티브 커먼즈 저작자표시-동일조건변경허락 라이선스로 배포된다는 점을 유의해 주세요(자세한 내용에 대해서는 가온 위키:저작권 문서를 읽어주세요). 만약 여기에 동의하지 않는다면 문서를 저장하지 말아 주세요.
또한, 직접 작성했거나 퍼블릭 도메인과 같은 자유 문서에서 가져왔다는 것을 보증해야 합니다. 저작권이 있는 내용을 허가 없이 저장하지 마세요!
취소 편집 도움말 (새 창에서 열림)

이 문서에서 사용한 틀: