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

큰숲백과, 나무를 보지 말고 큰 숲을 보라.
편집 요약 없음
편집 요약 없음
10번째 줄: 10번째 줄:
             mw.site.scriptPath,
             mw.site.scriptPath,
             mw.uri.buildQueryString {
             mw.uri.buildQueryString {
                 action = 'edit', title = article, editintro = editintro, preload = preload
                 -- action = 'edit',  
                title = article, editintro = editintro, preload = preload
             },
             },
             linkname)
             linkname)

2025년 1월 30일 (목) 18:05 판

local p = {}

p.makelink = function(article, linkname, preload, editintro, class)
    if mw.title.new(article).exists then
        return '[[' .. article .. (linkname and '|' .. linkname or '') .. ']]'
    else
        return string.format('<span class="plainlinks new %s">[%s%s/index.php?%s %s]</span>',
            class,
            mw.site.server,
            mw.site.scriptPath,
            mw.uri.buildQueryString {
                -- action = 'edit', 
                title = article, editintro = editintro, preload = preload
            },
            linkname)
    end
end

p.main = function(frame)
    local args = require('Module:Arguments').getArgs(frame)

    return p.makelink(args[1] or '', args[2] or args[1], args['preload'], args['editintro'], args['class'] or '')
end
------------------------------------------------------------------------------------
return p