모듈:Linkwithtemplate

하늘 (토론 | 기여)님의 2022년 3월 19일 (토) 17:25 판
설명문서 [편집] [역사] [새로고침]

asdf

연습장이나 사용자 문서에서 틀의 사용이나 수정을 연습할 수 있습니다.
분류는 /설명문서에 넣어주세요.

local p = {}

p.main = function(frame)
	local args = require('Module:Arguments').getArgs(frame)
	local doc = args[1] or ''
	local linkname = args[2] or nil
	local class = args['class'] or ''
	if mw.title.new(doc).exists then
		if linkname then
			return '[['..doc..'|'..linkname..']]'
		else
			return '[['..doc..']]'
		end
	else
		if linkname == nil then
			linkname = doc
		end
		return mw.getCurrentFrame():extensionTag('templatestyles', '', { src = '모듈:Linkwithtemplate/styles.css'})..'<span class="plainlinks new '..class..'">['..mw.uri.fullUrl(doc, mw.uri.buildQueryString({ 
		    	action = 'edit',
				preload = args['템플릿'],
		    	editintro = args['editintro'],
			    title = doc
			}))..' '..linkname..']</span>'
	end
end
p.test = p.main
------------------------------------------------------------------------------------
return p