모듈:코드 보여주기/연습장: 두 판 사이의 차이

편집 요약 없음
편집 요약 없음
3번째 줄: 3번째 줄:
function p.main(frame)
function p.main(frame)
local parts = require('Module:demo').get(frame)
local parts = require('Module:demo').get(frame)
if frame.args[1] == "col" then
if frame.args.dir == "col" then
return [[
return [[
|- style="/* tr */ display: flex; flex-direction: column; margin-bottom: 10px;"
|- style="/* tr */ display: flex; flex-direction: column; margin-bottom: 10px;"
12번째 줄: 12번째 줄:
    .. parts.output
    .. parts.output
    .. '</div>\n'
    .. '</div>\n'
elseif frame.args[1] == "row" then
elseif frame.args.dir == "row" then
    return [[
    return [[
|-
|-

2022년 6월 28일 (화) 13:48 판

이 모듈에 대한 설명문서는 모듈:코드 보여주기/연습장/설명문서에서 만들 수 있습니다

p = {}

function p.main(frame)
	local parts = require('Module:demo').get(frame)
	if frame.args.dir == "col" then
		return [[
			|- style="/* tr */ display: flex; flex-direction: column; margin-bottom: 10px;"
			| style="padding: 0; background-color: #f5f8fa;"|<pre style="margin: 0; border: 0; border-radius: 0; white-space: pre-line; background-color: transparent;">
		]]
		    .. parts.source
		    .. '</pre>\n|<div>'
		    .. parts.output
		    .. '</div>\n'
	elseif frame.args.dir == "row" then
	    return [[
			|-
			| style="padding: 0; background-color: #f5f8fa;"|<pre style="margin: 0; border: 0; border-radius: 0; white-space: pre-line; background-color: transparent;">
		]]
		    .. parts.source
		    .. '</pre>\n|<div>'
		    .. parts.output
		    .. '</div>\n'
	end
end

return p