Module:also/templates

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

This module implements the template {{also}}.


-- Prevent substitution.
if mw.isSubsting() then
	return require("Module:unsubst")
end

local export = {}

local get_script = require("Module:scripts").getByCode
local insert = table.insert
local process_params = require("Module:parameters").process
local yesno = require("Module:yesno")

function export.also_t(frame)
	local args = process_params(frame:getParent().args or frame.args, {
		 = {required = true, list = true},
		 = {list = true, allow_holes = true, require_index = true},
		 = {list = true, allow_holes = true, separate_no_index = true},
	})
	
	if args.sc.maxindex > 0 then
		require("Module:debug/track")("also/sc param")
	end
	
	local terms, sc, uni = {}, args.sc, args.uni
	for i, term in ipairs(args) do
		local sc_i = sc
		if sc_i then
			term = {term = term, sc = get_script(sc_i)}
		end
		local uni_i = uni
		if uni_i then
			if type(term) == "string" then
				term = {term = term}
			end
			-- If boolean false specified, set as `false`; otherwise, retain the input value.
			-- Exceptionally, "0" is treated as itself, not `false`.
			term.uni = uni_i == "0" and uni_i or yesno(uni_i, uni_i) and uni_i or false
		end
		insert(terms, term)
	end
	
	local uni_default = args.uni.default
	terms.uni_default = yesno(uni_default == "auto" or uni_default) and "auto" or nil
	
	return require("Module:also").main(terms)
end

return export