Module:links/templates: Difference between revisions
Jump to navigation
Jump to search
TheNightAvl (talk | contribs) mNo edit summary |
TheNightAvl (talk | contribs) mNo edit summary |
||
Line 14: | Line 14: | ||
["text"] = {}, | ["text"] = {}, | ||
["pos"] = {}, | ["pos"] = {}, | ||
["nobold"] = {}, | |||
} | } | ||
Revision as of 20:06, 26 August 2023
Documentation for this module may be created at Module:links/templates/documentation
local export = {}
local m_links = require("Module:links")
local m_languages = require("Module:languages")
local m_parameters = require("Module:parameters")
local params = {
[1] = {required = true},
[2] = {required = true},
[3] = {alias_of = "alt"},
["alt"] = {},
[4] = {alias_of = "text"},
["t"] = {alias_of = "text"},
["text"] = {},
["pos"] = {},
["nobold"] = {},
}
local function get_data(args)
local args = m_parameters.process(args, params)
return {
language = m_languages.get_by_code(args[1]),
term = args[2],
alt = args["alt"],
gloss = args["text"],
pos = args["pos"],
nobold = args["nobold"],
}
end
function export.link(frame)
return m_links.full_link(get_data(frame:getParent().args))
end
function export.mention(frame)
return m_links.full_link(get_data(frame:getParent().args), "term")
end
function export.mention_with_language_name(frame)
local data = get_data(frame:getParent().args)
data["showlanguage"] = true
return m_links.full_link(data, "term")
end
return export