模块:Lyrics/ext

来自维阿百科
跳转至: 导航搜索

此模块的文档可以在模块:Lyrics/ext/doc创建

local module = {}
 
local getArgs = require('Module:Arguments').getArgs
local buildLyrics = require('Module:Lyrics')._lyrics
local initHandler = require('Module:HooksHandler').init
 
function module.main(frame)
	local args = getArgs(frame, {wrappers={'Template:LyricsKai/ext', 'Template:LyricsKai/colors/hover', 'Template:LyricsKai/hover'}})
	args.type = frame.args.type or args.type
	local hooksHandler, customArgs = initHandler(), {}
	local hookTrigger = nil
	if args.type then
		local extend = mw.text.split(args.type, '%s*,%s*')
		for _, val in ipairs(extend) do
			if val ~= '' then
				hookTrigger = require('Module:Lyrics/'..val).initHooks(args, hooksHandler, customArgs)
			end
		end
	end
 
	return buildLyrics(args, hookTrigger, customArgs)
end
 
return module