Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Citation: Difference between revisions

From ProleWiki, the proletarian encyclopedia
mNo edit summary
mNo edit summary
Line 12: Line 12:
if is_set (Author) then
if is_set (Author) then
if is_set (Year) then
if is_set (Year) then
return Author .. "(" .. Year .. ")" .. ". "
return Author .. " (" .. Year .. ")" .. ". " .. "''" .. Title "''"
else
else
return Author .. ". "
return Author .. ". " .. "''" .. Title "''"
end
end
end
end
end
end
return p
return p

Revision as of 19:31, 27 October 2021

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 .. ")" .. ". " .. "''" .. Title "''"
			else
				return Author .. ". " .. "''" .. Title "''"
		end
	end
end
return p