문서 편집 권한이 없습니다. 다음 이유를 확인해주세요: 요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다: 사용자. 문서의 원본을 보거나 복사할 수 있습니다. local p = {} -- CSV 데이터를 받아 wikitable 형식으로 변환하는 함수 function p.csv(frame) local csv = frame.args[1] or '' local lines = {} local result = '{| class="wikitable timetable" style="border: 2px solid var(--text);"\n' -- CSV 데이터를 줄 단위로 분리 for line in csv:gmatch("[^\r\n]+") do table.insert(lines, line) end for i = 1, #lines do local row = lines[i] local values = {} -- 데이터를 쉼표로 분리하여 values 테이블에 저장 for value in row:gmatch("[^,]+") do value = value:gsub("x", "…") value = value:gsub("/", "<br/>") value = value:gsub("v", "レ") value = value:gsub("i", "‖") value = value:gsub("!R", 'colspan="2" |') value = value:gsub("!D", 'rowspan="2" |') value = value:gsub("!L", '--!--') value = value:gsub("!U", '--!--') if value == "--!--" then table.insert(values, "--!--") elseif string.find(value, "|") then table.insert(values, value) else table.insert(values, "|" .. value) end end for j, value in ipairs(values) do if value == "--!--" then else if j == 1 then values[j] = 'style="text-align: justify; text-align-last: justify; border-right: none;"' .. value elseif j == 2 then values[j] = 'style="text-align: justify; text-align-last: justify; border-left: none; border-right: 1px solid var(--text);"' .. value else values[j] = [[style="text-align: center; font-family: Monaco, 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace;"]] .. value end end end if i == 4 then result = result .. '|- style="border-bottom: double var(--text);"\n| ' .. table.concat(values, " || ") .. "\n" else result = result .. "|-\n| " .. table.concat(values, " || ") .. "\n" end end result = result .. "|}" return result end return p 이 문서에서 사용한 틀: 모듈:Timetable/설명문서 (원본 보기) 모듈:Timetable 문서로 돌아갑니다.