Module:Ts-headword

From Tsal Wiki
Jump to navigation Jump to search

Documentation for this module may be created at Module:Ts-headword/doc

local p = {}

local conj = require("Module:ts-conjugate")

function p.show(frame) 
	local part_of_speech = frame.args[1]
	
	
	local pagename = mw.title.getCurrentTitle().text
	if frame.args.pagename then pagename = frame.args.pagename end
	local metacategory = "[[Category: Tsal words]]"
	local category = "[[Category: Tsal " .. part_of_speech .. "]]"
	local boldedword = "'''" .. pagename .. "'''"
	
	local out = metacategory .. category .. "\n" .. boldedword
	
	if part_of_speech == "verbs" then
		out = out .. "\n"
		is_u = (frame.args[2] == "u")
		out = out .. conj.make_conjugation_table(pagename, is_u)
	end
	
	return out
end



return p