Minecraft Wiki
Advertisement
[만들기 | 역사 | 캐시 제거]설명문서
이 모듈의 설명문서가 없습니다. 이 모듈의 사용 방법을 안다면, 설명문서를 만들어 주십시오.
local p = {}
p.keys = function( f )
	local args = f
	if f == mw.getCurrentFrame() then
		args = f:getParent().args
	end
	local keys = {}
	
	for _, key in ipairs( args ) do
		key = mw.text.trim( key )
		if key ~= '+' and key:find( '%+' ) then
			local comboKeys = {}
			for comboKey in mw.text.gsplit( key, '%s*%+%s*' ) do
				table.insert( comboKeys, p.key( comboKey ) )
			end
			table.insert( keys, table.concat( comboKeys, ' + ' ) )
		else
			table.insert( keys, p.key( key ) )
		end
	end
	
	return table.concat( keys )
end

p.key = function( key )
	if key == '' then
		return ''
	end
	
	local symbols = mw.loadData( '모듈:Keys/Symbols' )
	return '<kbd class="key nowrap">' .. ( symbols[key:lower()] or key ) .. '</kbd>'
end
return p
Advertisement