편집을 취소할 수 있습니다. 이 편집을 되돌리려면 아래의 바뀐 내용을 확인한 후 게시해주세요.
최신판 | 당신의 편집 | ||
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(' | 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 |