Jump to content

Module:anchors/templates

From Wiktionary, the free dictionary

This module implements the following templates:

See their documentation for more information.


-- Prevent substitution.
if mw.isSubsting() then
	return require("Module:unsubst")
end

local m_anchors = require("Module:anchors")

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

local export = {}

function export.anchor_t(frame)
	return m_anchors.make_anchors(process_params(frame:getParent().args, load_data("Module:parameters/data").anchor)[1])
end

function export.senseid_t(frame)
	local args = process_params(frame:getParent().args, load_data("Module:parameters/data").senseid)
	return m_anchors.senseid(args[1], args[2], args.tag)
end

function export.etymid_t(frame)
	local args = process_params(frame:getParent().args, load_data("Module:parameters/data").etymid)
	return m_anchors.etymid(args[1], args[2])
end

return export