편집 요약 없음
편집 요약 없음
 
(같은 사용자의 중간 판 5개는 보이지 않습니다)
3번째 줄: 3번째 줄:
function tr(th, td)
function tr(th, td)
return "\n|-\n! " .. th .. "\n| " .. td
return "\n|-\n! " .. th .. "\n| " .. td
end
function paramize(s)
return "{{{" .. s .. "}}}"
end
end


12번째 줄: 8번째 줄:
result = ""
result = ""
for s in frame.args[1]:gmatch("[^\r\n]+") do
for s in frame.args[1]:gmatch("[^\r\n]+") do
result = result .. tr(s, paramize(s))
if (frame:getParent().args[s] and frame:getParent().args[s] ~= "") then
result = result .. tr(s, frame:getParent().args[s])
end
end
end
return "{| class='infobox'" ..  result .. "\n|}"
return "{| class='infobox'" ..  result .. "\n|}"

2022년 8월 1일 (월) 02:50 기준 최신판

이 모듈에 대한 설명문서는 모듈:연습장/설명문서에서 만들 수 있습니다

p = {} 

function tr(th, td)
	return "\n|-\n! " .. th .. "\n| " .. td
end

function p.main(frame)
	result = ""
	for s in frame.args[1]:gmatch("[^\r\n]+") do
		if (frame:getParent().args[s] and frame:getParent().args[s] ~= "") then
			result = result .. tr(s, frame:getParent().args[s])
		end
	end
	return "{| class='infobox'" ..  result .. "\n|}"
end

return p