This module is used by {{ux}}
to format the usage example for a definition line.
It delegates the actual work to Module:usex.
{{#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