Module:Kbd

Documentation for this module may be created at Module:Kbd/doc

local p = {}

-- =p.main({args={1="ar", 2="ba"}})
p.main = function ( frame )
	local args = frame.args or {}
	if #args == 0 and mw.getCurrentFrame():getParent() ~= nil then
		args = mw.getCurrentFrame():getParent().args
	end
	local kbds = {}
	for arg,val in pairs( args ) do
		local kbd = mw.html.create( 'kbd' ):wikitext( val )
		kbds[#kbds + 1] = tostring( kbd )
	end
	mw.logObject(kbds)
	local out = mw.html.create( 'span' )
		:addClass( 'mdl-kbd' )
		:wikitext( table.concat( kbds, '+' ) )
	return mw.getCurrentFrame():extensionTag( 'templatestyles', '', { src = "Module:Kbd/style.css" } ) .. tostring( out )
end

return p