Open main menu

Changes

Module:Citation

854 bytes added, 19:41, 31 August 2012
Added processing of more parameters.
local TransChapter = args["trans-chapter"] or args.trans_chapter
local Type = args.type
local URL ArchiveURL = args["archive-url"] or args.archiveurl or local URL = args.url
local ChapterURL = args["chapter-url"] or args.chapterurl
local Periodical = args.journal or args.newspaper or args.magazine or args.work or args.periodical
local SubscriptionRequired = args.subscription
local Via = args.via
local Accessed AccessDate = args.accessdate local ArchiveDate = args["archive-date"] or args.archivedate local DeadURL = args.deadurl
local Language = args.language
local Format = args.format
local RFC = args.rfc or args.RFC
local SSRN = args.ssrn or args.SSRN
local ZBL = args.zbl or args.ZBL local Quote = args.quote or args.quotation
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
end
if ( PublicationDate == Date or PublicationDate == Year ) then PublicationDate = nil end
if ( nil ~= ArchiveURL and "no" == DeadURL ) then
local temp = URL
URL = ArchiveURL
ArchiveURL = temp
end
if ( TransTitle ~= nil ) then TransTitle = " [" .. TransTitle .. "]." else TransTitle = "" end
if ( TransChapter ~= nil ) then TransChapter = " [" .. TransChapter .. "]." else TransChapter = "" end
if ( Date ~= nil ) then Date = " (" .. Date .. ")" else Date = "" end
if ( Via ~= nil ) then Via = " — via " .. Via else Via = "" end
if ( Accessed AccessDate ~= nil ) then Accessed AccessDate = " Accessed on " .. Accessed AccessDate .. "." else Accessed AccessDate = "" 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"}})
if ( URL ~= nil ) then URL = " " .. url(frame, URL) else URL = "" end
if ( ZBL ~= nil ) then ZBL = " " .. externallinkid(frame, {label="ZBL",link="Zentralblatt MATH",prefix="http://www.zentralblatt-math.org/zmath/en/search/?format=complete&q=an:",id=ZBL}) else ZBL = "" end
if ( Quote ~= nil ) then Quote = " \"" .. Quote .. "\"" else Quote = "" end
local Archived
if ( nil ~= ArchiveURL ) then
if ( ArchiveDate ~= nil ) then ArchiveDate = " (" .. ArchiveDate .. ")" else ArchiveDate = "" end
if ( "no" == DeadURL ) then
Archived = "[" .. ArchiveURL .. "Archived] from the original." .. ArchiveDate
else
Archived = "Archived from [" .. ArchiveURL .. " the original]." .. ArchiveDate
end
else
Archived = ""
end
local Publisher
if ( Periodical ~= nil ) then
-- 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 idcommon = ARXIV .. ASIN .. BIBCODE .. DOI .. ID .. ISBN .. JFM .. JSTOR .. LCCN .. MR .. OCLC .. OL .. OSTI .. PMC .. PMID .. RFC .. SSRN .. URL .. ZBL .. Accessed AccessDate .. Archived .. Via .. SubscriptionRequired.. Quote
local tcommon = Title .. Type .. Format .. Edition .. Language .. Periodical .. Series .. Volume .. Issue .. Page .. Pages .. At .. "."
Date = Date .. OrigYear
Anonymous user