경고: 이 문서의 오래된 판을 편집하고 있습니다. 이것을 게시하면, 이 판 이후로 바뀐 모든 편집이 사라집니다.귀하는 로그인되어 있지 않습니다. 이대로 편집하면 귀하의 IP 주소가 편집 기록에 남게 됩니다.스팸 방지 검사입니다. 이것을 입력하지 마세요!--This module implements {{Documentation}}. local p = {} function p.corps(frame) args = frame:getParent().args local page = mw.title.getCurrentTitle() doc = p.docname(page) local corps = {} if page.subpageText == 'sandbox' then table.insert(corps, '<div style="clear:both />') table.insert(corps, frame:preprocess('{{Template sandbox notice}}')) end table.insert(corps, p.header(page)) table.insert(corps, p.content(frame, page)) table.insert(corps, p.footer(page)) if args.raw then return frame:preprocess('<nowiki>' .. table.concat(corps) .. '</nowiki>\n:' .. os.clock()) end return table.concat(corps) end function p.docname(page) if not page.isSubpage then return page.subjectNsText .. ":" .. page.text .. "/doc" end if page.subpageText == 'doc' or page.subpageText == 'sandbox' or page.subpageText == 'testcases' then return page.subjectNsText .. ":" .. page.baseText .. "/doc" else return page.subjectNsText .. ":" .. page.text .. "/doc" end end function p.ifexist(page) if not page then return false end if mw.title.new(page).exists then return true end return false end function p.header(page) local header = {'<div class="template-documentation"'} if args.color then table.insert(header, ' style="background:') table.insert(header, args.color .. '"') end table.insert(header, '><div style="margin-bottom:1ex; border-bottom:1px solid #aaa; padding-bottom:3px;">') table.insert(header, '[[File:Template-info.png|50px|alt=Template documentation|link=]]') table.insert(header, '<span style="font-weight:bold; font-size:125%"> ') if args.heading then table.insert(header, args.heading) else table.insert(header, 'Template documentation') end table.insert(header, '</span>') if not args.content then table.insert(header, '<span class="mw-editsection plainlinks">[[') local arg = mw.title.new(args[1] or doc) if args[1] and p.ifexist(args[1]) or p.ifexist(doc) then table.insert(header, arg:fullUrl('action=view') .. ' view]') table.insert(header, '] [[') table.insert(header, arg:fullUrl('action=edit') .. ' edit]') table.insert(header, '] [[') table.insert(header, arg:fullUrl('action=history') .. ' history]') table.insert(header, '] [[') table.insert(header, page:fullUrl('action=purge') .. ' purge]') else table.insert(header, arg:fullUrl({["action"]="edit", ["preload"]="Template:Documentation/preload"})) table.insert(header, ' create]') end table.insert(header, ']</span>') end table.insert(header, '</div>') return table.concat(header) end function p.content(frame, page) local content = {} local arg = args[1] or doc if args.content then table.insert(content, '\n') table.insert(content, args.content) else table.insert(content, frame:preprocess('<nowiki />')) table.insert(content, '\n') if args[1] and p.ifexist(args[1]) or p.ifexist(doc) then table.insert(content, frame:preprocess('{{' .. arg .. '}}')) end end table.insert(content, '\n') table.insert(content, frame:preprocess('<nowiki />')) table.insert(content, '<div style="clear:both" />\n') return table.concat(content) end function p.footer(page) local footer = {} local arg = mw.title.new(args[1] or doc) table.insert(footer, '</div><div class="template-documentation plainlinks" ') table.insert(footer, 'style="font-style:italic; margin:2px 0px 0px; padding: 0.35em 0.9em') if args.color then table.insert(footer, '; background:') table.insert(footer, args.color) end table.insert(footer, ';">\n') if args.content then if args["link box"] then table.insert(footer, args["link box"]) else table.insert(footer, 'This documentation is directly included in this page.') end else if args[1] and p.ifexist(args[1]) or p.ifexist(doc) then table.insert(footer, 'The above [[Wikipedia:Template documentation|documentation]] is ') table.insert(footer, '[[Wikipedia:Transclusion|transcluded]] from [[') table.insert(footer, tostring(arg)) table.insert(footer, ']] <span style="font-size:89%; font-style:normal;">([') table.insert(footer, arg:fullUrl('action=edit')) table.insert(footer, ' edit] | [') table.insert(footer, arg:fullUrl('action=history') .. ' history])</span>.<br />') end table.insert(footer, 'Editors can experiment in this templates ') local sandbox = arg.subjectNsText .. ":" .. arg.baseText .. "/sandbox" local argsandbox = mw.title.new(sandbox) if p.ifexist(sandbox) then table.insert(footer, '[[' .. sandbox .. '|sandbox]]') table.insert(footer, ' <span style="font-size:89%; font-style:normal;">([') table.insert(footer, argsandbox:fullUrl('action=edit')) table.insert(footer, ' edit])</span>') else table.insert(footer, 'sandbox <span style="font-size:89%; font-style:normal;">([') table.insert(footer, argsandbox:fullUrl({["action"]="edit", ["preload"]="Template:Documentation/preload-sandbox"})) table.insert(footer, ' create])</span>') end table.insert(footer, ' and ') local test = arg.subjectNsText .. ":" .. arg.baseText .. "/testcases" local argtest = mw.title.new(test) if p.ifexist(test) then table.insert(footer, '[[' .. test .. '|testcases]]') table.insert(footer, ' <span style="font-size:89%; font-style:normal;">([') table.insert(footer, argtest:fullUrl('action=edit')) table.insert(footer, ' edit])</span>') else table.insert(footer, 'testcases <span style="font-size:89%; font-style:normal;">([') table.insert(footer, argtest:fullUrl({["action"]="edit", ["preload"]="Template:Documentation/preload-testcases"})) table.insert(footer, ' create])</span>') end table.insert(footer, ' pages.<br />Please add categories to the ') table.insert(footer, '<span class="plainlinks">[') if args[1] and p.ifexist(args[1]) or p.ifexist(doc) then table.insert(footer, arg:fullUrl('action=edit')) else table.insert(footer, arg:fullUrl({["action"]="edit", ["preload"]="Template:Documentation/preload"})) end table.insert(footer, ' /doc] subpage.') end table.insert(footer, '</div>') return table.concat(footer) end return p 편집 요약 가온 위키에서의 모든 기여는 크리에이티브 커먼즈 저작자표시-동일조건변경허락 라이선스로 배포된다는 점을 유의해 주세요(자세한 내용에 대해서는 가온 위키:저작권 문서를 읽어주세요). 만약 여기에 동의하지 않는다면 문서를 저장하지 말아 주세요. 또한, 직접 작성했거나 퍼블릭 도메인과 같은 자유 문서에서 가져왔다는 것을 보증해야 합니다. 저작권이 있는 내용을 허가 없이 저장하지 마세요! 취소 편집 도움말 (새 창에서 열림) 이 문서에서 사용한 틀: 모듈:Documentation/설명문서 (편집)