모듈:Documentation: 두 판 사이의 차이

327 바이트 추가됨 ,  2022년 11월 4일 (금)
편집 요약 없음
잔글 (update code comment according to Special:Diff/989669779)
편집 요약 없음
117번째 줄: 117번째 줄:
function p.nonexistent(frame)
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
--return frame:expandTemplate{title = 'module test cases notice'}
return frame:expandTemplate{title = '틀 설명문서/끝상자'}
else
else
return p.main(frame)
return p.main(frame)
134번째 줄: 135번째 줄:
root
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
--:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
:tag('div')
214번째 줄: 215번째 줄:
-- The title object for the current page, or a test page passed with args.page.
-- The title object for the current page, or a test page passed with args.page.
local title
local title
local titleArg = args.page
local titleArg = (args.page or args["문서"])
if titleArg then
if titleArg then
title = mw.title.new(titleArg)
title = mw.title.new(titleArg)
415번째 줄: 416번째 줄:
end
end


function p.protectionTemplate(env)
--function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- -- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- -- Messages:
-- 'protection-template' --> 'pp-template'
-- -- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
-- -- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
-- local protectionLevels = env.protectionLevels
if not protectionLevels then
-- if not protectionLevels then
return nil
-- return nil
end
-- end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
-- local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
-- local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- if editProt then
-- The page is edit-protected.
-- -- The page is edit-protected.
return require('Module:Protection banner')._main{
-- return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
-- message('protection-reason-edit'), small = true
}
-- }
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- -- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- -- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
-- -- no move protection at all.
return require('Module:Protection banner')._main{
-- return require('Module:Protection banner')._main{
action = 'move', small = true
-- action = 'move', small = true
}
-- }
else
-- else
return nil
-- return nil
end
-- end
end
--end


----------------------------------------------------------------------------
----------------------------------------------------------------------------
462번째 줄: 463번째 줄:
env = env or p.getEnvironment(args)
env = env or p.getEnvironment(args)
local links
local links
local content = args.content
local content = (args.content or args["내용"])
if not content or args[1] then
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
-- No need to include the links if the documentation is on the template page itself.
514번째 줄: 515번째 줄:
data.purgeLinkDisplay = message('purge-link-display')
data.purgeLinkDisplay = message('purge-link-display')
-- Create link if /doc doesn't exist.
-- Create link if /doc doesn't exist.
local preload = args.preload
local preload = (args.preload or args["미리싣기"])
if not preload then
if not preload then
if subjectSpace == 828 then -- Module namespace
if subjectSpace == 828 then -- Module namespace
584번째 줄: 585번째 줄:
-- Heading
-- Heading
local heading = args.heading -- Blank values are not removed.
local heading = (args.heading or args["제목"]) -- Blank values are not removed.
if heading == '' then
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
-- Don't display the start box if the heading arg is defined but blank.
602번째 줄: 603번째 줄:
-- Heading CSS
-- Heading CSS
local headingStyle = args['heading-style']
local headingStyle = (args['heading-style'] or args['제목-모양'])
if headingStyle then
if headingStyle then
data.headingStyleText = headingStyle
data.headingStyleText = headingStyle
655번째 줄: 656번째 줄:
env = env or p.getEnvironment(args)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local docTitle = env.docTitle
local content = args.content
local content = (args.content or args["내용"])
if not content and docTitle and docTitle.exists then
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
669번째 줄: 670번째 줄:
env = env or p.getEnvironment(args)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
if not (args.content or args["내용"]) and docTitle and docTitle.exists then
return docTitle.prefixedText
return docTitle.prefixedText
else
else
701번째 줄: 702번째 줄:
-- box by default if the documentation exists or if we are in the
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
-- user, module or template namespaces.
local linkBox = args['link box']
local linkBox = (args['link box'] or args["연결상자"])
if linkBox == 'off'
if linkBox == 'off'
or not (
or not (
724번째 줄: 725번째 줄:
-- "Editors can experiment in this template's sandbox and testcases pages."
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
if not (args.content or args["내용"]) and not args[1] then
-- "Please add categories to the /doc subpage."
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- Don't show this message with inline docs or with an explicitly specified doc page,
익명 사용자