본문으로 이동

미디어위키 1.45 안정화가 거의 끝났습니다. 다만 Flow 확장 기능 관련 이슈가 있어서 대체하는 작업을 수행할 계획입니다.

  1. 큰숲백과:청사진에서 위키 발전의 대략적인 방향성을 제시했습니다. 의견이 있으신 분은 큰숲백과토론:청사진에서 의견을 남겨주시면 좋겠습니다.
  2. 기능상의 오류로 지원하지 않고 있는 기능에 대해서는 큰숲백과토론:이슈 트래커에 요약했습니다. 참고하시기 바랍니다.
  3. 데이터베이스 덤프 받고싶으신 분은 큰숲백과 가입 후에 사용자토론:Bigforest에 의견 남겨주시면 ftp 주소, 계정, 비밀번호를 특수:EmailUser를 통해서 공개할 예정입니다.

모듈:Lua banner

큰숲백과, 나무를 보지 말고 큰 숲을 보라.

{{#css: .template-documentation {

   clear: both;
   margin: 1em 0 0 0;
   padding: 1em

} /* 아래 상자 */ .mbox-text {

   clear: both;
   background-color: #e8ffe8;

}

.template-documentation-template-data .mw-templatedata-doc-desc {

   display: none;

}

}}

설명문서 [보기] [편집] [역사] [새로 고침]
이 모듈 문서의 출처는 위키백과:모듈:Lua banner입니다.
{{루아}}의 구현에 사용됩니다.
위 설명은 모듈:Lua banner/설명문서의 내용을 가져와 보여주고 있습니다.
연습장이나 사용자 문서에서 틀의 사용이나 수정을 연습할 수 있습니다.
분류는 /설명문서에 넣어주세요. 이 틀의 하위문서.

-- This module implements the {{lua}} template.
--한국어 위키백과에서 가져왔습니다. 
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')

local p = {}

function p.main(frame)
	local origArgs = frame:getParent().args
	local args = {}
	for k, v in pairs(origArgs) do
		v = v:match('^%s*(.-)%s*$')
		if v ~= '' then
			args[k] = mw.title.new(v, 'Module').text  -- remove Namespace
		end
	end
	return p._main(args)
end

function p._main(args)
	local modules = mTableTools.compressSparseArray(args)
	local box = p.renderBox(modules)
	local trackingCategories = p.renderTrackingCategories(args, modules)
	return box .. trackingCategories
end

function p.renderBox(modules)
	local boxArgs = {}
	if #modules < 1 then
		boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
	else
		local moduleLinks = {}
		for i, module in ipairs(modules) do
			moduleLinks[i] = string.format('[[:모듈:%s]]', module)
		end
		local moduleList = mList.makeList('bulleted', moduleLinks)
		boxArgs.text = '[[위키백과:루아|루아]] 사용:\n' .. moduleList
	end
	boxArgs.type = 'notice'
	boxArgs.small = true
	boxArgs.image = '[[File:Lua-logo-nolabel.svg|30px|alt=Lua logo|link=위키백과:루아]]'
	return mMessageBox.main('mbox', boxArgs)
end

function p.renderTrackingCategories(args, modules, titleObj)
	if yesno(args.nocat) then
		return ''
	end
	
	local cats = {}
	
	-- Error category
	if #modules < 1 then
		cats[#cats + 1] = 'Lua templates with errors'
	end
	
	-- Lua templates category
	titleObj = titleObj or mw.title.getCurrentTitle()
	local subpageBlacklist = {
		doc = true,
		sandbox = true,
		sandbox2 = true,
		testcases = true,
		['설명문서'] = true,
		['연습장']= true,
		['시험장'] = true,
	}
	if titleObj.namespace == 10 
		and not subpageBlacklist[titleObj.subpageText]
	then
		local category = args.category
		if not category then
			local categories = {
				['String'] = '루아 String 틀',
				['Math'] = '루아 Math 틀',
				['Hangul'] = '루아 Hangul 틀',
				['Citation'] = '루아 Citation 틀',
				['BaseConvert'] = '루아 BaseConvert 틀'
			}
			categories['Citation/CS1'] = categories['Citation']
			category = modules[1] and categories[modules[1]]
			category = category or '루아 틀'
		end
		cats[#cats + 1] = category
	end
	
	for i, cat in ipairs(cats) do
		cats[i] = string.format('[[Category:%s]]', cat)
	end
	return table.concat(cats)
end

return p