Jump to content

Module:Citation/CS1: Difference between revisions

added sepc for separator character between parameters; set "OCLC"
m>Wikid77
(set AccessDate + <span class="reference-accessdate">; fixed url when deadurl=no.)
m>Wikid77
(added sepc for separator character between parameters; set "OCLC")
Line 333: Line 333:
     local Transcript = args.transcript
     local Transcript = args.transcript
     local TranscriptURL = args["transcript-url"] or args.transcripturl
     local TranscriptURL = args["transcript-url"] or args.transcripturl
    local sepc = args.separator
    if ( config.CitationClass == "citation" ) then sepc = "," end
    if ( sepc == nil ) then sepc = "." end
     if ( DeadURL == nil ) then DeadURL = "no" end
     if ( DeadURL == nil ) then DeadURL = "no" end


Line 590: Line 594:
     if ( Volume ~= nil ) then Volume = " <b>" .. Volume .. "</b>" else Volume = "" end
     if ( Volume ~= nil ) then Volume = " <b>" .. Volume .. "</b>" else Volume = "" end
     if ( Issue ~= nil ) then Issue = " (" .. Issue .. ")" else Issue = "" end
     if ( Issue ~= nil ) then Issue = " (" .. Issue .. ")" else Issue = "" end
     if ( Series ~= nil ) then Series = ". " .. Series else Series = "" end
     if ( Series ~= nil ) then Series = sepc .. " " .. Series else Series = "" end
     if ( Format ~= nil ) then Format = " (" .. Format .. ")" else Format = "" end
     if ( Format ~= nil ) then Format = " (" .. Format .. ")" else Format = "" end
     if ( OrigYear ~= nil ) then OrigYear = " [" .. OrigYear .. "]" else OrigYear = "" end
     if ( OrigYear ~= nil ) then OrigYear = " [" .. OrigYear .. "]" else OrigYear = "" end
     if ( Agency ~= nil ) then Agency = ". " .. Agency else Agency = "" end
     if ( Agency ~= nil ) then Agency = sepc .. " " .. Agency else Agency = "" end
     ------------------------------------ totally unrelated data
     ------------------------------------ totally unrelated data
     if ( Date ~= nil ) then Date = Date else Date = "" end
     if ( Date ~= nil ) then Date = Date else Date = "" end
     if ( Via ~= nil ) then Via = " &mdash; via " .. Via .. "." else Via = "" end
     if ( Via ~= nil ) then Via = " &mdash; via " .. Via .. sepc else Via = "" end
     if ( AccessDate ~= nil )
     if ( AccessDate ~= nil )
     then AccessDate = '<span class="reference-accessdate"> Retrieved ' .. AccessDate .. '.</span>'
     then AccessDate = '<span class="reference-accessdate"> Retrieved ' .. AccessDate .. '.</span>'
Line 616: Line 620:
     if ( LCCN ~= nil ) then LCCN = " " .. externallinkid(frame, {label="LCCN",link="Library of Congress Control Number",prefix="http://lccn.loc.gov/",id=LCCN}) else LCCN = "" end
     if ( LCCN ~= nil ) then LCCN = " " .. externallinkid(frame, {label="LCCN",link="Library of Congress Control Number",prefix="http://lccn.loc.gov/",id=LCCN}) else LCCN = "" end
     if ( MR ~= nil ) then MR = " " .. externallinkid(frame, {label="MR",link="Mathematical Reviews",prefix="http://www.ams.org/mathscinet-getitem?mr=",id=MR}) else MR = "" end
     if ( MR ~= nil ) then MR = " " .. externallinkid(frame, {label="MR",link="Mathematical Reviews",prefix="http://www.ams.org/mathscinet-getitem?mr=",id=MR}) else MR = "" end
     if ( OCLC ~= nil ) then OCLC = " " .. externallinkid(frame, {label="OCLC",link="Online Computer Library Center",prefix="//www.worldcat.org/oclc/",id=OCLC}) else OCLC = "" end
     if ( OCLC ~= nil ) then OCLC = " " .. externallinkid(frame, {label="OCLC",link="OCLC",prefix="//www.worldcat.org/oclc/",id=OCLC}) else OCLC = "" end
     if ( OL ~= nil ) then OL = " " .. openlibrary(frame, OL) else OL = "" end
     if ( OL ~= nil ) then OL = " " .. openlibrary(frame, OL) else OL = "" end
     if ( OSTI ~= nil ) then OSTI = " " .. externallinkid(frame, {label="OSTI",link="Office of Scientific and Technical Information",prefix="http://www.osti.gov/energycitations/product.biblio.jsp?osti_id=",id=OSTI}) else OSTI = "" end
     if ( OSTI ~= nil ) then OSTI = " " .. externallinkid(frame, {label="OSTI",link="Office of Scientific and Technical Information",prefix="http://www.osti.gov/energycitations/product.biblio.jsp?osti_id=",id=OSTI}) else OSTI = "" end
Line 684: Line 688:
     else tcommon = Title .. TitleType .. TitleNote .. Series .. Language .. Format .. Edition .. Conference .. Periodical .. Volume .. Others .. Issue .. Publisher .. Agency .. Position end
     else tcommon = Title .. TitleType .. TitleNote .. Series .. Language .. Format .. Edition .. Conference .. Periodical .. Volume .. Others .. Issue .. Publisher .. Agency .. Position end
     -- DEBUG: tcommon = "/Title="..Title .. "/TitleType="..TitleType .. "/TitleNote="..TitleNote .. "/Format="..Format .. "/Edition="..Edition .. "/Language="..Language .. "/Conference="..Conference .. "/Periodical="..Periodical .. "/Series="..Series .. "/Volume="..Volume .. "/Issue="..Issue .. "/Position="..Position
     -- DEBUG: tcommon = "/Title="..Title .. "/TitleType="..TitleType .. "/TitleNote="..TitleNote .. "/Format="..Format .. "/Edition="..Edition .. "/Language="..Language .. "/Conference="..Conference .. "/Periodical="..Periodical .. "/Series="..Series .. "/Volume="..Volume .. "/Issue="..Issue .. "/Position="..Position
     local enddot = "."
     local enddot = sepc
     if (Title == "") then enddot = "" end
     if (Title == "") then enddot = "" end
     if ( string.sub(tcommon,-1,1) == ".") then enddot = "" end
     if ( string.sub(tcommon,-1,1) == sepc) then enddot = "" end
     if ( config.CitationClass == "journal") then enddot = "" end
     if ( config.CitationClass == "journal") then enddot = "" end
     tcommon = tcommon .. enddot
     tcommon = tcommon .. enddot
Line 703: Line 707:
         text = Editors .. Date .. Chapter .. tcommon .. Page .. Pages .. At .. idcommon
         text = Editors .. Date .. Chapter .. tcommon .. Page .. Pages .. At .. idcommon
     else
     else
         if ( "" ~= Date ) then Date = " " .. Date .. "." end
         if ( "" ~= Date ) then Date = " " .. Date .. "'''" .. string.sub(".",-1,-1) .. "'''" end
         text = Chapter .. tcommon .. Date .. Page .. Pages .. At .. idcommon
         text = Chapter .. tcommon .. Date .. Page .. Pages .. At .. idcommon
     end
     end
      
      
     -- Now enclose the whole thing in a <span/> element
     -- Now enclose the whole thing in a <span/> element
     if ( Year == nil ) then Year = "" end
     if ( Year == nil ) then Year = string.sub(Date,-3) end
     local args = { class="citation " .. (config.CitationClass or "") }
     local args = { class="citation " .. (config.CitationClass or "") }
     if ( Ref ~= nil ) then  
     if ( Ref ~= nil ) then  
Line 1,007: Line 1,011:
--20Feb2013 Set AccessDate + <span class="reference-accessdate">
--20Feb2013 Set AccessDate + <span class="reference-accessdate">
--20Feb2013 Fixed url when deadurl=no.
--20Feb2013 Fixed url when deadurl=no.
--20Feb2013 Added sepc for separator character between parameters.
--20Feb2013 Put "OCLC" for "Online Computer Library Center".
--
--
--End
--End
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.