Module:User:Jberkel/usex/templates

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

This module is used by {{ux}} to format the usage example for a definition line. It delegates the actual work to Module:usex.

Exported functions

usex_t

{{#invoke:usex/templates|usex_t}}

Format a usage example. See {{ux}} for more.


local m_usex = require("Module:User:Jberkel/usex")

local export = {}

function export.usex_t(frame)
	local params = {
		 = {required = true},
		 = {},
		 = {},
		
		 = {type = "boolean"},
		 = {type = "boolean"},
		 = {},
		 = {},
		 = {},
		 = {alias_of = 3},
		 = {alias_of = 3},
		 = {},
		 = {alias_of = "tr"},
		 = { list = true }
	}
	
	local quote = (frame.args or "") ~= ""
	local compat = (frame.args or "") ~= ""
	
	if compat then
		params = {required = true}
		params.alias_of = 2
		params.alias_of = 2
		table.remove(params, 1)
	end
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local lang = args or "und"
	local sc = args
	
	lang = require("Module:languages").getByCode(lang) or error("The language code \"" .. lang .. "\" is not valid.")
	sc = (sc and (require("Module:scripts").getByCode(sc) or error("The script code \"" .. sc .. "\" is not valid.")) or nil)
	
	local usex = args
	local translation = args
	local transliteration = args
	local noenum = args
	local inline = args
	local ref = args
	local lit = args
	local qualifier = args
	
	return m_usex.format_usex(lang, sc, usex, translation, transliteration, noenum, inline, ref, quote, lit, qualifier)
end

return export