Open main menu

Changes

Module:Citation

2,687 bytes added, 18:59, 7 September 2012
Added processing of more parameters.
local Conference = args.conference
local TransTitle = args.trans_title
local TitleNore TitleNote = args.department local TitleLink = args.titlelink or args.episodelink
local Chapter = args.chapter or args.article or args.entry
local ChapterLink = args.chapterlink
local TransChapter = args["trans-chapter"] or args.trans_chapter
local TitleType = args.type
local Volume = args.volume
local Issue = args.issue or args.number
local Position = nil
local Page = args.page
local Pages = args.pages
local LaySummary = args.laysummary
local LaySource = args.laysource
local Transcript = args.transcript
local TranscriptURL = args["transcript-url"] or args.transcripturl
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
if ( BookTitle ) then
Chapter = Title
ChapterLink = TitleLink
TransChapter = TransTitle
Title= BookTitle TitleLink = nil
TransTitle = nil
end
-- Account for the oddity that is {{cite episode}}, before generation of COinS data.
if config.CitationClass == "episode" then
local AirDate = args.airdate
local SeriesLink = args.serieslink
local Season = args.season
local SeriesNumber = args.seriesnumber or args.seriesno
local Network = args.Network
local Station = args.Station
local s = {}
if Number ~= nil then table.insert(s, "episode " .. Number) Number = nil end
if Season ~= nil then table.insert(s, "season " .. Season) end
if SeriesNumber ~= nil then table.insert(s, "series " .. SeriesNumber) end
local n = {}
if Network ~= nil then table.insert(n, Network) end
if Station ~= nil then table.insert(n, Station) end
Date = Date or AirDate
Chapter = Title
ChapterLink = TitleLink
TransChapter = TransTitle
Title = Series
TitleLink = SeriesLink
TransTitle = nil
local Sep = args["series-separator"] or args["separator"] or ". "
Series = table.concat(s, Sep)
ID = table.concat(n, Sep)
end
if ( Date ~= nil ) then
local Month = args.month
if ( Month ~== nil ) then Date local Began = Month args.. " " .. Date began local Day Ended = args.dayended if ( Day Began ~= nil and Ended ~= nil ) then Date Month = Day Began .. " –" .. Date Ended else Month = "–" end
end
Date = Month .. " " .. Date
local Day = args.day
if ( Day ~= nil ) then Date = Day .. " " .. Date end
end
end
if ( TransTitle ~= nil ) then TransTitle = " [" .. TransTitle .. "]." else TransTitle = "" end
if ( TransChapter ~= nil ) then TransChapter = " [" .. TransChapter .. "]." else TransChapter = "" end
if ( Chapter ~= nil ) then if ( ChapterLink ~= nil ) then Chapter = "[[" .. ChapterLink .. "|" .. Chapter .. "]]" end
if ( Periodical ~= nil ) then
Chapter = "''" .. Chapter .. "''"
end
Chapter = Chapter .. TransChapter
if ( ChapterLink == nil ) then if ( ChapterURL ~= nil ) then Chapter = "[" .. ChapterURL .. " " .. Chapter .. "]" elseif ( URL ~= nil ) then Chapter = "[" .. URL .. " " .. Chapter .. "]" URL = nil end
end
Chapter = " " .. Chapter .. "."
end
if ( Title ~= nil ) then
if ( TitleLink ~= nil ) then Title = "[[" .. TitleLink .. "|" .. Title .. "]]" end
if ( Periodical ~= nil ) then
Title = "\"" .. Title .. "\""
end
Title = Title .. TransTitle
if ( TitleLink == nil and URL ~= nil ) then
Title = "[" .. URL .. " " .. Title .. "]"
URL = nil
Conference = ""
end
if ( nil ~= Position or nil ~= Page or nil ~= Pages ) then At = nil end if ( nil == Position ) then local Minutes = args.minutes if ( nil ~= Minutes ) then Position = " " .. Minutes .. " minutes in" else local Time = args.time if ( nil ~= Time ) then local TimeCaption = args.timecaption or "Event occurs at" Position = " " .. TimeCaption .. " " .. Time else Position = "" end end else Position = " " .. Position end
if ( nil == Page ) then
Page = ""
else
Lay = ""
end
if ( nil ~= Transcript ) then
if ( TranscriptURL ~= nil ) then Transcript = "[" .. TranscriptURL .. Transcript .. "]" end
else
Transcript = ""
end
local Publisher
-- 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 .. AccessDate .. Archived .. Via .. SubscriptionRequired .. Lay .. Quote .. PostScript
local tcommon = Title .. TitleType .. TitleNote .. Format .. Edition .. Language .. Conference .. Periodical .. Series .. Volume .. Issue .. Position .. Page .. Pages .. At .. "."
Date = Date .. OrigYear
local text
Anonymous user