Module:User:Lunabunn/Q

Hello, you have come here looking for the meaning of the word Module:User:Lunabunn/Q. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:User:Lunabunn/Q, but we will also tell you about its etymology, its characteristics and you will know how to say Module:User:Lunabunn/Q in singular and plural. Everything you need to know about the word Module:User:Lunabunn/Q you have here. The definition of the word Module:User:Lunabunn/Q will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:User:Lunabunn/Q, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.


local export = {}

local function eval(key, d_work, defaults, args)
	local d = d_work or defaults
	if d == nil then
		return args
	end
	local function fetch(var)
		if var == key then
			return args
		else
			return d_work or defaults or args 
		end
	end
	return d:gsub("{{(-):(-)}}", function (var, ind)
		var = fetch(var)
		return var and var
	end):gsub("{{(-)}}", fetch)
end

function export.make(frame)
	local parent_args = frame:getParent().args
	local params = {
		 = { required = true, type = "language", default = "und" },
		 = {},
		 = { alias_of = "year" },
		 = {},
		 = { alias_of = "author" },
		 = {},
		 = { alias_of = "title" },
		 = {},
		 = {},
		 = {},
	}
	local args = require("Module:parameters").process(parent_args, params, true)
	
	local data = mw.loadData("Module:User:Lunabunn/Q/" .. args:getCode() .. "/data")
	while data.author_aliases do
		args.author = data.author_aliases
	end
	local d_author = data
	while d_author.work_aliases do
		args.title = d_author.work_aliases
	end
	local d_work = d_author.works
	local defaults = d_author.defaults
	
	args.year = eval("year", d_work, defaults, args)
	args.title = eval("title", d_work, defaults, args)
	args.object = eval("object", d_work, defaults, args)
	args.section = eval("section", d_work, defaults, args)
	
	args.titlestyle = d_work.titlestyle or defaults.titlestyle or args.titlestyle
	
	return require("Module:User:Lunabunn/quote").Q(frame, args)
end

return export