모듈:KoreanPresidents

삼쩌모 (토론 | 기여)님의 2026년 1월 2일 (금) 09:48 판

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

local p = {}

local presidents = {
	[1]  = { name = "이승만" },
	[2]  = { name = "이승만" },
	[3]  = { name = "이승만" },
	[4]  = { name = "윤보선" },
	[5]  = { name = "박정희" },
	[6]  = { name = "박정희" },
	[7]  = { name = "박정희" },
	[8]  = { name = "박정희" },
	[9]  = { name = "박정희" },
	[10] = { name = "최규하" },
	[11] = { name = "전두환" },
	[12] = { name = "전두환" },
	[13] = { name = "노태우" },
	[14] = { name = "김영삼" },
	[15] = { name = "김대중" },
	[16] = { name = "노무현" },
	[17] = { name = "이명박" },
	[18] = { name = "박근혜" },
	[19] = { name = "문재인" },
	[20] = { name = "윤석열" },
	[21] = { name = "이재명" }
}
function p.render(frame)
	local n = tonumber(frame.args[1])
	if not n or not presidents[n] then
		return "잘못된 대수입니다."
	end

	local prev = presidents[n - 1] and presidents[n - 1].name or "—"
	local curr = presidents[n].name
	local next = presidents[n + 1] and presidents[n + 1].name or "—"

	return string.format([[{| class="wikitable" style="border: 2px solid #005ba6; text-align: center; margin-left:auto; margin-right:auto; width:100%%; max-width:400px;"
|-
! colspan="3" style="background: linear-gradient(to right,#00467f,#005ba6 20%%,#005ba6 80%%,#00467f); color:#ffc224; padding: 7px; font-size: 1.1rem" | 대한민국 대통령
|-
! width="33%%" | 전임
! width="33%%" | 제%d대
! width="33%%" | 후임
|-
| %s
| '''%s'''
| %s
|}
]], n, prev, curr, next)
end


return p