Changes
Added processing of more parameters.
local PublicationPlace = args.publicationplace or args.place or args.location
local Publisher = args.publisher
local SubscriptionRequired = args.subscription
local Via = args.via
local Accessed = args.accessdate
local Language = args.language
local Format = args.format
if ( Format ~= nil ) then Format = " (" .. Format .. ")" else Format = "" end
if ( Date ~= nil ) then Date = " (" .. Date .. ")" else Date = "" end
if ( Via ~= nil ) then Via = " — via " .. Via else Via = "" end
if ( Accessed ~= nil ) then Accessed = " Accessed on " .. Accessed .. "." else Accessed = "" end
if ( SubscriptionRequired ~= nil ) then
SubscriptionRequired = z.wikitext.tag(frame, {name="span", contents="(subscription required)", params={style="font-size:0.95em; font-size: 90%; color: #555"}})
else
SubscriptionRequired = ""
end
if ( ARXIV ~= nil ) then ARXIV = " " .. externallinkid(frame, {label="arXiv",link="arXiv",prefix="http://arxiv.org/abs/",id=ARXIV,separator=":"}) else ARXIV = "" end
if ( ASIN ~= nil ) then ASIN = " " .. amazon(frame, ASIN, ASINTLD) else ASIN = "" end
-- Piece all of the bits together at last. At this point, all of these should be guaranteed non-nil.
-- We build things this way because it is more efficient in LUA not to keep reassigning to the same string variable over and over.
local identifiers common = ARXIV .. ASIN .. BIBCODE .. DOI .. ID .. ISBN .. JFM .. JSTOR .. LCCN .. MR .. OCLC .. OL .. OSTI .. PMC .. PMID .. RFC .. SSRN .. URL .. ZBL.. Accessed .. Via .. SubscriptionRequired
local text
if ( "" ~= Authors ) then
if ( "" ~= Date ) then Date = Date .. "." else Authors = Authors .. "." end
if ( "" ~= Editors ) then Editors = " in " .. Editors .. "." end
text = Authors .. Date .. Chapter .. Editors .. Title .. Format .. Edition .. Language .. Volume .. Issue .. Pages .. Series .. PublicationPlace .. Publisher .. identifierscommon
elseif ( "" ~= Editors) then
Editors = Editors .. " (eds.)"
if ( "" ~= Date ) then Date = Date .. "." else Editors = Editors .. "." end
text = Editors .. Date .. Chapter .. Title .. Format .. Edition .. Language .. Volume .. Issue .. Pages .. Series .. PublicationPlace .. Publisher .. identifierscommon
else
text = Chapter .. Title .. Format .. Edition .. Language .. Volume .. Issue .. Pages .. Series .. PublicationPlace .. Publisher .. Date .. identifierscommon
end