Module:etymology/templates/derived: Difference between revisions

From Linguifex
Jump to navigation Jump to search
(Created page with "local export = {} function export.derived(frame) local args, lang, term, sources = require("Module:etymology/templates/internal").parse_2_lang_args(frame) if sources then...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
local export = {}
local export = {}
local etymology_module = "Module:etymology"
local etymology_multi_module = "Module:etymology/multi"
local etymology_templates_internal_module = "Module:etymology/templates/internal"


function export.derived(frame)
function export.derived(frame)
local args, lang, term, sources = require("Module:etymology/templates/internal").parse_2_lang_args(frame)
local args, lang, term, sources = require(etymology_templates_internal_module).parse_2_lang_args(frame)
if sources then
if sources then
return require("Module:etymology/multi").format_multi_derived(lang, term.sc, sources, term, args.sort,
return require(etymology_multi_module).format_multi_derived {
args.nocat, args.conj, "derived")
lang = lang,
sc = term.sc,
sources = sources,
terminfo = term,
sort_key = args.sort,
nocat = args.nocat,
conj = args.conj,
template_name = "derived",
to_wik = true,
}
else
else
return require("Module:etymology").format_derived(lang, term, args.sort, args.nocat, "derived")
return require(etymology_module).format_derived {
lang = lang,
terminfo = term,
sort_key = args.sort,
nocat = args.nocat,
template_name = "derived",
to_wik = true,
}
end
end
end
end


return export
return export

Latest revision as of 18:16, 15 September 2024

Documentation for this module may be created at Module:etymology/templates/derived/doc

local export = {}

local etymology_module = "Module:etymology"
local etymology_multi_module = "Module:etymology/multi"
local etymology_templates_internal_module = "Module:etymology/templates/internal"

function export.derived(frame)
	local args, lang, term, sources = require(etymology_templates_internal_module).parse_2_lang_args(frame)
	if sources then
		return require(etymology_multi_module).format_multi_derived {
			lang = lang,
			sc = term.sc,
			sources = sources,
			terminfo = term,
			sort_key = args.sort,
			nocat = args.nocat,
			conj = args.conj,
			template_name = "derived",
			to_wik = true,
		}
	else
		return require(etymology_module).format_derived {
			lang = lang,
			terminfo = term,
			sort_key = args.sort,
			nocat = args.nocat,
			template_name = "derived",
			to_wik = true,
		}
	end
end

return export