Module:glossary

Hello, you have come here looking for the meaning of the word Module:glossary. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:glossary, but we will also tell you about its etymology, its characteristics and you will know how to say Module:glossary in singular and plural. Everything you need to know about the word Module:glossary you have here. The definition of the word Module:glossary will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:glossary, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

The test_existence function tracks instances of {{glossary}} that link to anchors not found in Appendix:Glossary. See Category:Pages linking to anchors not found in Appendix:Glossary. It uses the data module Module:glossary/data to determine if the anchor exists.


local export = {}

local require_when_needed = require("Module:require when needed")

local anchor_encode = mw.uri.anchorEncode
local normalize_anchor = require_when_needed("Module:get IDs", "normalize_anchor")
local nowiki = require_when_needed("Module:string/nowiki")

function export.def(frame)
	local required_default_ = {required = true, default = ""}
	local args = require("Module:parameters").process(frame:getParent().args, {
		 = required_default_,
		 = required_default_,
	})
	
	local term = args
	return "; <span id=\"" .. anchor_encode(term) .. "\">" .. term .. "</span>\n: " .. args
end

local function get_link(formatted_anchor, text, anchor)
	return "]"
end

function export.link(frame)
	local args = require("Module:parameters").process(frame:getParent().args, {
		 = {required = true, default = ""},
		 = true,
	})
	
	local data = mw.loadData("Module:glossary/data")
	
	local anchor, text = args, args
	local formatted_anchor = normalize_anchor(anchor)
	if data then
		return get_link(formatted_anchor, text, anchor)
	end
	
	local lower_anchor = anchor:ulower()
	formatted_anchor = normalize_anchor(lower_anchor)
	
	local link = get_link(formatted_anchor, text, anchor)
	
	if data or formatted_anchor == "" then
		return link
	end
	
	mw.log("The anchor " .. lower_anchor
		.. (lower_anchor ~= anchor and " or " .. anchor or "")
		.. " does not exist in Appendix:Glossary.")
	
	return link
		.. "[[Category:Pages linking to anchors not found in Appendix:Glossary|"
		.. lower_anchor .. "]]"
end

return export