Modul:fiu-fin-headword

A modult a Modul:fiu-fin-headword/doc lapon tudod dokumentálni

local export = {}

local lang = require("Module:languages").getByCode("fiu-fin-pro")

-- The main entry point.
-- This is the only function that can be invoked from a template.
function export.show(frame)
	local args = frame:getParent().args
	SUBPAGENAME = mw.title.getCurrentTitle().subpageText
	
	local head = args["head"]; if head == "" then head = nil end
	
	-- The part of speech. This is also the name of the category that
	-- entries go in. However, the two are separate (the "cat" parameter)
	-- because you sometimes want something to behave as an adjective without
	-- putting it in the adjectives category.
	local poscat = frame.args[1] or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")
	local cat = args["cat"]; if cat == "" then cat = nil end
	
	local data = {lang = lang, pos_category = cat or poscat, categories = {}, heads = {head}}
	
	return require("Module:headword").full_headword(data)
end

return export