모듈:Linkwithtemplate 편집하기

편집하면 당신의 IP 주소가 공개적으로 기록됩니다. 계정을 만들고 로그인하면 편집 시 사용자 이름만 보이며, 위키 이용에 여러 가지 편의가 주어집니다.

편집을 취소할 수 있습니다. 이 편집을 되돌리려면 아래의 바뀐 내용을 확인한 후 게시해주세요.

최신판 당신의 편집
1번째 줄: 1번째 줄:
local p = {}
local p = {}


p.main = function(frame)
p.test = function(frame)
    local args = require('Module:Arguments').getArgs(frame)
local args = require('Module:Arguments').getArgs(frame)
    local doc = args[1] or ''
local doc = args[1] or ''
    local linkname = args[2] or nil
local linkname = args[2] or nil
    local class = args['class'] or ''
local class = args['class'] or ''
   
 
    if mw.title.new(doc).exists then
if mw.title.new(doc).exists then
        if linkname then
if linkname then
            return string.format('[[%s|%s]]', doc, linkname)
return '[['..doc..'|'..linkname..']]'
        else
else
            return string.format('[[%s]]', doc)
return '[['..doc..']]'
        end
end
    else
else
        if linkname == nil then
if linkname == nil then
            linkname = doc
linkname = doc
        end
end
        return string.format('<span class="plainlinks">[%s <span style="color: #ba0000>%s</span>]</span>',
return '<span class="plainlinks new '..class..'">['..mw.site.server..'/index.php?'..
            tostring(mw.uri.fullUrl(doc, { action = 'edit', preload = args['템플릿'], editintro = args['editintro'] })),
mw.uri.buildQueryString {
            linkname)
    action = 'edit',
    end
preload = args['템플릿'],
    editintro = args['editintro'],
    title = doc
}..' '..linkname..']</span>'
end
end
end
p.test = p.main
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
return p
return p
리브레 위키에서의 모든 기여는 크리에이티브 커먼즈 저작자표시-동일조건변경허락 3.0 라이선스로 배포됩니다(자세한 내용에 대해서는 리브레 위키:저작권 문서를 읽어주세요). 만약 여기에 동의하지 않는다면 문서를 저장하지 말아 주세요.
글이 직접 작성되었거나 호환되는 라이선스인지 확인해주세요. 리그베다 위키, 나무위키, 오리위키, 구스위키, 디시위키 및 CCL 미적용 사이트 등에서 글을 가져오실 때는 본인이 문서의 유일한 기여자여야 하고, 만약 본인이 문서의 유일한 기여자라는 증거가 없다면 그 문서는 불시에 삭제될 수 있습니다.
취소 편집 도움말 (새 창에서 열림)

| () [] [[]] {{}} {{{}}} · <!-- --> · [[분류:]] · [[파일:]] · [[미디어:]] · #넘겨주기 [[]] · {{ㅊ|}} · <onlyinclude></onlyinclude> · <includeonly></includeonly> · <noinclude></noinclude> · <br /> · <ref></ref> · {{각주}} · {|class="wikitable" · |- · rowspan=""| · colspan=""| · |}