Module:anchors/templates

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This module implements the following templates:

See their documentation for more information.


local m_anchors = require("Module:anchors")

local process_params = require("Module:parameters").process

local export = {}

function export.anchor_t(frame)
	return m_anchors.make_anchors(process_params(frame:getParent().args, {
		{required = true, list = true},
	})[1])
end

function export.senseid_t(frame)
	local args = process_params(frame:getParent().args, {
		[1] = {required = true, type = "language", default = "und"},
		[2] = {required = true, default = ""},
		tag = {set = {"li", "p", "span"}, default = "li"},
	})
	return m_anchors.senseid(args[1], args[2], args.tag)
end

function export.etymid_t(frame)
	local args = process_params(frame:getParent().args, {
		[1] = {required = true, type = "language", default = "und"},
		[2] = {required = true, default = ""}
	})
	return m_anchors.etymid(args[1], args[2])
end

return export