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

편집 요약 없음
편집 요약 없음
2번째 줄: 2번째 줄:


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


return p
return p

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

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

p = {}

function p.main(frame)
	local parts = require('Module:demo').get(frame)
	if frame.args[1] == "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[1] == "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