Module:Citation

From ProleWiki, the proletarian encyclopedia
Revision as of 19:30, 27 October 2021 by Forte (talk | contribs)
local p = {}

local function is_set (var)
	return not (var == nil or var == '');
end

function p.cite( frame )
	local pframe = frame:getParent()
	Author = pframe.args.author
	Title = pframe.args.title
	Year = pframe.args.year
	if is_set (Author) then
		if is_set (Year) then
			return Author .. "(" .. Year .. ")" .. ". "
			else
				return Author .. ". "
		end
	end
end
return p