Difference between revisions 21306604 and 21306605 on frwiktionary

local export = {}

-- The main entry point.
-- This is the only function that can be invoked from a template.
function export.show(frame)
	if mw.title.getCurrentTitle().nsText == "Template" then
		return "(This template should be used on pages in the Category: namespace.)"
	elseif mw.title.getCurrentTitle().nsText ~= "Category" then
(contracted; show full)		["label_exists"] = "exists",
		["display_name"] = "getBreadcrumbName",
		["edit"] = "getDataModule",
		
		["basic"] = "getBasicName",
		["description"] = "getBasicDescription",
		["parents"] = "getBasicParentLabels",

		["subs"] = "getBasicChildLabels",
		
		["umbrella"] = "getUmbrellaName",
		["umbrella_description"] = "getUmbrellaDescription",
		["sortparentumbrella"] = "getUmbrellaSortKey",
		["umbrella-categorization"] = "getUmbrellaCategorizationType",
		
		["fundamental"] = "getFundamentalName",
	}
	
	if item:find("^sub[1-9][0-9]?$") then
		returnlocal ret = submodule.get_item(info, item)
	elseif functions[item] then
		if submodule[functions[item]] then
			return submodule[functions[item]](info)
		else
			require("Module:debug").track("category tree/get item")
			require("Module:debug").track("category tree/get item/" .. item)
		
		if ret then
			require("Module:debug").track("category tree/get item")
		end
		
		return ret
	elseif functions[item] then
		return submodule.get_[functions[item]](info, item)
		end)
	else
		error("The requested data item \"" .. item .. "\" is not recognized.")
	end
end

-- Check the name of the current page, and return an error if it's not right.
function check_name(info)
(contracted; show full)			return mw.getCurrentFrame():expandTemplate{title = TOC_template.text, args = {}}
		end
	end
	
	return nil
end

return export