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

편집 요약 없음
편집 요약 없음
6번째 줄: 6번째 줄:
local linkname = args[2] or nil
local linkname = args[2] or nil
local class = args['class'] or ''
local class = args['class'] or ''
frame:extensionTag()
if mw.title.new(doc).exists then
if mw.title.new(doc).exists then
if linkname then
if linkname then

2022년 3월 1일 (화) 17:53 판

설명문서 [편집] [역사] [새로고침]

asdf

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

local p = {}

p.test = 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 frame:extensionTag('templatestyles', '', { src = '모듈:Linkwithtemplate/styles.css'})..'<span class="plainlinks new '..class..'">['..mw.site.server..'/index.php?'..
			mw.uri.buildQueryString {
		    	action = 'edit',
				preload = args['템플릿'],
		    	editintro = args['editintro'],
			    title = doc
			}..' '..linkname..']</span>'
	end
end
------------------------------------------------------------------------------------
return p