모듈:코드 보여주기: 두 판 사이의 차이

편집 요약 없음
편집 요약 없음
 
(같은 사용자의 중간 판 2개는 보이지 않습니다)
3번째 줄: 3번째 줄:
function p.main(frame)
function p.main(frame)
local parts = require('Module:demo').get(frame)
local parts = require('Module:demo').get(frame)
local result
if frame.args["dir"] == "col" then
if frame.args["dir"] == "col" then
return [[
result = '|- style="/* tr */ display: flex; flex-direction: column-reverse; margin-bottom: 20px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.03), 0 4px 6px -4px rgba(0, 0, 0, 0.03);"'
|- style="/* tr */ display: flex; flex-direction: column-reverse; margin-bottom: 20px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.03), 0 4px 6px -4px rgba(0, 0, 0, 0.03);"
| 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
elseif frame.args["dir"] == "row" then
    return [[
    result = '|-'
|-
| 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'
else
else
return "ERROR: NO DIR OPTION"
return "ERROR: NO DIR OPTION"
end
end
return result
.. '\n| style="overflow: scroll; padding: 0; background-color: #f5f8fa;"|<pre style="margin: 0; border: 0; border-radius: 0; background-color: transparent;">'
    .. parts.source
    .. '</pre>\n| style="overflow: scroll;" | <div>'
    .. parts.output
    .. '</div>\n'
end
end


return p
return p

2022년 6월 28일 (화) 16:31 기준 최신판

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

p = {}

function p.main(frame)
	local parts = require('Module:demo').get(frame)
	local result
	if frame.args["dir"] == "col" then
		result = '|- style="/* tr */ display: flex; flex-direction: column-reverse; margin-bottom: 20px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.03), 0 4px 6px -4px rgba(0, 0, 0, 0.03);"'
	elseif frame.args["dir"] == "row" then
	    result = '|-'
	else
		return "ERROR: NO DIR OPTION"
	end
	return result
		.. '\n| style="overflow: scroll; padding: 0; background-color: #f5f8fa;"|<pre style="margin: 0; border: 0; border-radius: 0; background-color: transparent;">'
	    .. parts.source
	    .. '</pre>\n| style="overflow: scroll;" | <div>'
	    .. parts.output
	    .. '</div>\n'
end

return p