Zum Inhalt springen

Modul:Citation

Aus Wikivoyage
Dokumentation für das ModulCitation[Ansicht] [Bearbeiten] [Versionsgeschichte] [Aktualisieren]

Verwendung

Das Modul wird direkt von den Vorlagen {{Buch}}, {{Karte}}, {{Sammelwerk}}, {{Zeitschrift}} und {{Zeitung}} aufgerufen. Parameterbeschreibung siehe dort.

Versionsbezeichnung auf Wikidata:2024-06-16Ok!

Stilvorlagen

Benötigte weitere Module

Dieses Modul benötigt folgende weitere Module:Check isxnCitation/COinSCitation/i18nCitation/utilitiesLinkISBNUrlCheckYesno

Prüfungen

Die Prüfung der einzelnen Angaben wird, soweit möglich, mit Lua-Pattern vorgenommen. Bei ISBN, ISSN und deutschen URN wird die Prüfziffer ausgewertet.

Literatur

Hinweise
-- documentation
localcitation={
suite='Citation',
serial='2024-06-16',
item=56159597
}

-- module import
-- require( 'strict' )
localcu=require('Module:Citation/utilities')
localcc=require('Module:Citation/COinS')
localci=require('Module:Citation/i18n')
localcx=require('Module:Check isxn')
localli=require('Module:LinkISBN')
localuc=require('Module:UrlCheck')
localyn=require('Module:Yesno')

-- module variable
localct={
moduleInterface=citation
}

-- check for valid arguments against params table
localfunctiongetValidArgs(frameArgs)
localargs={}
localcomplete={}
localwrongParams={}

forkey,valueinpairs(ci.params)do
ifnotvalue.typesorcu.inArray(value.types,frameArgs.type)then
forkey2,value2inipairs(value)do
complete[value2]=key
args[key]=args[key]or
(key~='bibcode'andcu.parameterCleanup(frameArgs[value2])orframeArgs[value2])
end
args[key]=args[key]or''
end
end
-- no missing items
forkey,valueinpairs(ci.params)do
ifnotargs[key]then
args[key]=''
end
end

forkey,valueinpairs(frameArgs)do
ifnotcomplete[key]then
table.insert(wrongParams,key)
end
end
if#wrongParams==1then
cu.addErrorMsg(cu.formatItem(wrongParams[1],ci.texts.unknownParam))
elseif#wrongParams>0then
cu.addErrorMsg(cu.formatItem(table.concat(wrongParams,', '),ci.texts.unknownParams))
end
returnargs
end

localfunctioncheckRedundantParams(args,keys)
locali=0
for_,keyinipairs(keys)do
ifcu.isSet(args[key])then
i=i+1
ifi>1then
returntrue
end
end
end
returnfalse
end

-- check parameter values
localfunctioncheckValues(args)
localwrong={}
locali

ifcu.isSet(args.title)then
args.title=args.title:gsub('%s*%.+$','')
end

-- convert book with chapter to collection
ifargs.type=='book'andnotcu.isSet(args.collection)andcu.isSet(args.chapter)then
args.type='bookitem'
args.collection,args.title,args.chapter=args.title,args.chapter,''
args.siteUrl,args.url,args.chapterUrl=args.url,args.chapterUrl,''
end

if(args.type=='web'orargs.type=='webnews')
andnotcu.isSet(args.title)andnotcu.isSet(args.url)then
args.title=ci.texts.noTitle
cu.addErrorMsg(ci.texts.noTitleUrl)
elseifnotcu.isSet(args.title)then
args.title=ci.texts.noTitle
cu.addErrorMsg(ci.texts.unknownTitle)
end

args.pages=cu.cleanupPageNumbers(args.pages)
args.columns=cu.cleanupPageNumbers(args.columns)

if(cu.getNumber(args.KBytes)/1024>100)or
(cu.getNumber(args.MBytes)>100)then
cu.addErrorMsg(ci.texts.moreThan100)
end
ifcu.isSet(args.KBytes)then
args.KBytes=args.KBytes:gsub('%s*%[sic!%]','')
end
ifcu.isSet(args.MBytes)then
args.MBytes=args.MBytes:gsub('%s*%[sic!%]','')
end
ifcu.isSet(args.KBytes)andcu.isSet(args.MBytes)then
args.MBytes=''
cu.addErrorMsg(ci.texts.KBytesMBytes)
end

args.ignoreError=yn(args.ignoreError,false)
ifargs.ignoreErrorthen
args.ignoreError='true'
else
args.ignoreError='false'
end

-- containing date format detected from args.date
args.dateFormat=''
ifcu.isSet(args.date)then
ifargs.date:match('^[12]%d%d%d%-[01]?%d%-[0123]?%d$')then
args.dateFormat='j. F Y'
elseifargs.date:match('^[12]%d%d%d%-[01]?%d$')then
args.dateFormat='M Y'
elseifargs.date:match('^[12]%d%d%d$')then
args.dateFormat='Y'
elseifmw.ustring.match(args.date,'^[12]%d%d%d[-‒–—][12]%d%d%d$')or
mw.ustring.match(args.date,'^[12]%d%d%d[-‒–—]$')then
args.date=mw.ustring.gsub(args.date,'[-‒–—]','–')
args.dateFormat='R'
else
args.date=args.date:match('%d+')or''
ifcu.isSet(args.date)then
i=tonumber(args.date)
ifi>=1000andi<2100then
args.dateFormat='Y'
else
args.date=''
cu.addErrorMsg(ci.texts.wrongDate)
end
end
end
end
forkey,valueinipairs({'accessDate','archiveDate'})do
ifcu.isSet(args[value])and
notargs[value]:match('^20%d%d%-[01]?%d%-[0123]?%d$')then
args[value]=''
cu.addErrorMsg(ci.texts.wrongDate)
end
end

forkey,valueinipairs({'url','archiveUrl'})do
ifcu.isSet(args[value])and
uc.isUrl(args[value],ci.skipPathCheck)>2then
args[value]=''
cu.addErrorMsg(ci.texts.noURL)
end
end
ifcu.isSet(args.url)then
for_,urlinipairs(ci.unwantedUrls)do
ifargs.url:find(url,1,true)then
cu.addErrorMsg(ci.texts.unwantedURL)
break
end
end
end
args.urlStatus=cu.getKey(args.urlStatus,ci.urlStatusTable)
ifnotcu.isSet(args.urlStatus)andcu.isSet(args.archiveUrl)then
args.urlStatus='dead'
elseifnotcu.isSet(args.urlStatus)then
args.urlStatus='live'
end
args.isArchived=cu.isSet(args.archiveUrl)
ifargs.urlStatus=='dead'orargs.urlStatus=='usurped'then
args.originalUrl=args.url
args.url=args.archiveUrl
args.archiveUrl=''
end

forkey,valueinipairs({'dnb','oclc','jstor','pmid','KBytes'})do
ifcu.isSet(args[value])andnotargs[value]:match('^[1-9]%d*$')then
args[value]=''
table.insert(wrong,value)
end
end

ifcu.isSet(args.asin)then
ifargs.asin:match("^%d%d%d%d%d%d%d%d%d[%dX]$")then
ifnotcu.isSet(args.isbn)andnotargs.asin:find('^63[01]')and
cx.check_isbn({args={[1]=args.asin,error='error'}})~='error'then
args.isbn=args.asin
end
args.asin=''
table.insert(wrong,'asin')
elseifnotargs.asin:match("^%u[%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u]$")then
args.asin=''
table.insert(wrong,'asin')
end
end

ifcu.isSet(args.ol)then
args.ol=args.ol:gsub('^OL','')
ifnotargs.ol:match('^[1-9]%d*[AMW]$')then
args.ol=''
table.insert(wrong,'ol')
end
end

localmatch,country
ifcu.isSet(args.urn)then
args.urn=args.urn:lower():gsub('^urn:','')
match,country=args.urn:match('^(nbn:(%l%l):[%d%l%-%.:/_]+)$')
ifnot(matchandcountryandci.nbnResolving[country])then
args.urn=''
table.insert(wrong,'urn')
end
end
ifcu.isSet(args.urn)andci.nbnCheckDigit[country]and
notcu.check_UrnNbn('urn:'..args.urn)then
cu.addErrorMsg(ci.texts.wrongURN)
end

-- in suffix spaces or n-dashes and at the end periods or commas are not allowed
ifcu.isSet(args.doi)andnotmw.ustring.match(args.doi,'^10%.[1-9]%d%d%d%d?/[^%s–]-[^%.,]$')then
args.doi=''
table.insert(wrong,'doi')
end

ifcu.isSet(args.hdl)andnotmw.ustring.match(args.hdl,'^[1-9][%d%.]*%d/[^%s–]-[^%.,]$')then
args.hdl=''
table.insert(wrong,'hdl')
end

ifnotcu.isSet(args.url)then
for_,keyinipairs(ci.additionalTitleUrls)do
ifcu.isSet(args[key])then
args.url=ci.params[key].url:format(args[key])
ifkey=='urn'then
args.urn=''
end
break
end
end
end

-- See: https://arxiv.org/help/arxiv_identifier
ifcu.isSet(args.arxiv)andnot(
-- 1991-07… 2007-03
args.arxiv:match('^%a[%a%.%-]+/[90]%d[01]%d%d%d%d$')orargs.arxiv:match('^%a[%a%.%-]+/[90]%d[01]%d%d%d%d[vV]%d+$')or
-- 2007-04… 2014-12
args.arxiv:match('^[01]%d[01]%d%.%d%d%d%d$')orargs.arxiv:match('^[01]%d[01]%d%.%d%d%d%d[vV]%d+$')or
-- 2015-01…
args.arxiv:match('^%d%d[01]%d%.%d%d%d%d%d$')orargs.arxiv:match('^%d%d[01]%d%.%d%d%d%d%d[vV]%d+$'))then
args.arxiv=''
table.insert(wrong,'arXiv')
end

-- See: https://adsabs.harvard.edu/abs_doc/help_pages/data.html#bibcodes
ifcu.isSet(args.bibcode)and
not(args.bibcode:len()==19andargs.bibcode:match('^[12]%d%d%d%a[%w&%.][%w&%.][%w&%.][%w%.]+[%a%.]$'))then
args.bibcode=''
table.insert(wrong,'bibcode'..args.bibcode:len())
end
ifcu.isSet(args.bibcode)then
args.bibcode=args.bibcode:gsub('%.','#b#')-- keep bibcode periods (full stops)
end

ifcu.isSet(args.edition)andargs.edition:match('^%d+%.*$')then
args.edition=args.edition:gsub('%.','')
ifargs.edition=='1'then
args.edition=''
end
end

ifcu.isSet(args.type)andargs.type~='map'then
args.scale=''
end

ifcu.isSet(args.access)then
args.access=cu.getKey(args.access,ci.accessTypes)
ifargs.access==''then
cu.addErrorMsg(ci.texts.accesswrong)
elseifnotcu.isSet(args.url)andnotcu.isSet(args.archiveUrl)and
notcu.isSet(args.doi)andnotcu.isSet(args.hdl)and
notcu.isSet(args.jstor)then
cu.addErrorMsg(ci.texts.accessNoUrl)
end
end

ifcheckRedundantParams(args,{'isbn','dnb','urn','oclc','ol','asin'})or
checkRedundantParams(args,{'doi','hdl','jstor','arxiv','bibcode'})then
cu.addErrorMsg(ci.texts.redundantParams)
end

if#wrong==1then
cu.addErrorMsg(cu.formatItem(wrong[1],ci.texts.wrongValue))
elseif#wrong>1then
cu.addErrorMsg(cu.formatItem(table.concat(wrong,', '),ci.texts.wrongValues))
end
end

localfunctionformatIdentifier(tab,key,urlPart,text,add)
ifcu.isSet(urlPart)andcu.isSet(text)then
text=ci.params[key].prefix..
cu.makeLink(ci.params[key].url:gsub('%%s',urlPart),text)..
(addor'')
table.insert(tab,text)
end
end

localfunctionaddIssn(tab,issn,ignoreError)
ifcu.isSet(issn)then
localadd=ignoreError~='true'andci.texts.wrongIssnor''
add=cx.check_issn({args={[1]=issn,error=add}})
formatIdentifier(tab,'issn',issn,issn,add)
end
end

-- make author part
localfunctionmakeAuthor(author,editor)
author=cu.formatItem(author,ci.formatters.auAuthor)
editor=cu.formatItem(editor,ci.formatters.auEditor)
ifcu.isSet(author)andcu.isSet(editor)then
author=cu.formatItem2(author,editor,ci.formatters.auAuthorEditor)
elseifnotcu.isSet(author)andcu.isSet(editor)then
author=editor
end
returncu.formatItem(author,ci.formatters.auAuthorAll)
end

-- make title part
localfunctionmakeTitle(title,volume,addition,url,scale,titleType)
iftitleType=='bookitem'then
title=cu.formatItem(title,ci.formatters.tiCollectionTitle)
elseiftitleType=='journal'then
title=cu.formatItem(title,ci.formatters.tiJournalTitle)
else
title=cu.formatItem(title,ci.formatters.tiTitle)
end
ifnotcu.isSet(title)then
title=ci.texts.noTitle
cu.addErrorMsg(ci.texts.unknownTitle)
else
title=title:gsub("''+",'')-- remove multiple apostrophes
end
ifcu.isSet(url)then
title=cu.makeLink(url,title:gsub('[%[%]]',''))
end

ifcu.isSet(volume)then
title=cu.formatItem2(title,volume,ci.formatters.tiVolume)
end
ifcu.isSet(addition)then
title=cu.formatItem2(title,addition,ci.formatters.tiAddition)
end
returncu.formatItem(title,ci.formatters.tiAll)
..cu.formatItem(scale,ci.formatters.tiScale)
end

-- make publisher part for books
localfunctionmakePublisher(args,tab)
localtheDate=''
ifcu.isSet(args.date)then
ifcu.isSet(args.dateFormat)andargs.dateFormat~='Y'andargs.dateFormat~='R'then
args.dateFormat='M Y'
end
theDate=cu.getDate(args.date,args.dateFormat,ci.texts.wrongDate)
end

localpublished=''

ifcu.isSet(args.edition)then
ifargs.edition:match('^%d+$')then
theDate=cu.formatItem2(theDate,args.edition,ci.formatters.puDateEditionNum)
else
theDate=cu.formatItem2(theDate,args.edition,ci.formatters.puDateEdition)
end
end

localplace=cu.formatItem(args.place,ci.formatters.puPlace)
localpublisher=cu.formatItem(args.publisher,ci.formatters.puPublisher)
ifcu.isSet(place)andcu.isSet(publisher)then
published=cu.formatItem2(place,publisher,ci.formatters.puPlacePub)
elseifcu.isSet(place)then
published=place
elseifcu.isSet(publisher)then
published=publisher
end

theDate=cu.formatItem(theDate,ci.formatters.puDate)
ifnotcu.isSet(published)then
published=theDate
elseifcu.isSet(theDate)then
published=cu.formatItem2(published,theDate,ci.formatters.puPlaceDate)
end
cu.insertItem(tab,published)
end

localfunctionmakeIsbn(args,tab)
ifcu.isSet(args.isbn)then
table.insert(tab,
li._linkISBNSet({isbn=args.isbn,ignoreError=args.ignoreError}))
elseifcu.isSet(args.dnb)then
formatIdentifier(tab,'dnb',args.dnb,args.dnb)
elseifcu.isSet(args.urn)then
formatIdentifier(tab,'urn',args.urn,args.urn)
elseifcu.isSet(args.oclc)then
formatIdentifier(tab,'oclc',args.oclc,args.oclc)
elseifcu.isSet(args.ol)then
localprefix={
A='authors/OL',
M='books/OL',
W='works/OL'
};
formatIdentifier(tab,'ol',prefix[args.ol:sub(-1)]..args.ol,args.ol)
elseifcu.isSet(args.asin)then
formatIdentifier(tab,'asin',args.asin,args.asin)
end
addIssn(tab,args.issn,args.ignoreError)
addIssn(tab,args.eissn,args.ignoreError)
end

localfunctionformatPages(s)
returnmw.ustring.gsub(s,'-','–')
end

localfunctionmakePages(args,tab)
cu.insertItem(tab,formatPages(args.pages),ci.formatters.addPages)
cu.insertItem(tab,formatPages(args.columns),ci.formatters.addColumns)
end

localfunctionmakeDoi(args,tab)
ifcu.isSet(args.extent)then
ifargs.extent:match('^%d+$')then
args.extent=cu.formatItem(args.extent,ci.formatters.addExtent)
end
table.insert(tab,args.extent)
end
for_,keyinipairs({'doi','hdl','jstor','arxiv','bibcode'})do
ifcu.isSet(args[key])then
formatIdentifier(tab,key,args[key],args[key])
break
end
end
formatIdentifier(tab,'pmid',args.pmid,args.pmid)
end

localfunctionmakeWebInfo(args,tab)
localext,kb
ifcu.isSet(args.url)orcu.isSet(args.originalUrl)orcu.isSet(args.archiveUrl)
orcu.isSet(args.siteUrl)orcu.isSet(args.chapterUrl)then
ifcu.isSet(args.accessDate)then
args.accessDate=cu.getDate(args.accessDate,'j. F Y',ci.texts.wrongDate)
cu.insertItem(tab,args.accessDate,ci.formatters.wbAccess)
end
ifcu.isSet(args.format)then
table.insert(tab,args.format:upper())
else
fori,urlinipairs({args.url,args.chapterUrl,args.siteUrl,
args.archiveUrl})do
ext=cu.getExtension(url)
ifextthen
table.insert(tab,ext)
break
end
end
end
ifcu.isSet(args.KBytes)then
kb=tonumber(args.KBytes)or0
ifkb>=1024then
cu.insertItem(tab,
tostring(cu.round(kb/1024,3)):gsub('%.',ci.texts.decimalPoint),
ci.formatters.wbMBytes)
else
cu.insertItem(tab,args.KBytes,ci.formatters.wbKBytes)
end
elseifcu.isSet(args.MBytes)then
cu.insertItem(tab,args.MBytes,ci.formatters.wbMBytes)
end
end
end

localfunctionmakeArchived(args)
localarchived=ci.formatters.arArchived
localoriginal=ci.formatters.arOriginal
localresult=''

ifcu.isSet(args.archiveUrl)then
archived=cu.makeLink(args.archiveUrl,archived)
end
ifcu.isSet(args.originalUrl)then
original=cu.makeLink(args.originalUrl,original)
end

localarchiveDay='',result
ifcu.isSet(args.archiveDate)then
archiveDay=cu.getDate(args.archiveDate,'l, j. F Y',ci.texts.wrongDate)
end

ifarchiveDay~=''then
ifargs.isArchivedthen
result=mw.ustring.format(ci.formatters.arArchiveDate,archived,original,archiveDay)
else
result=cu.formatItem(original,ci.formatters.arOffline)
end
else
ifcu.isSet(args.archiveDate)then
cu.addErrorMsg(ci.texts.wrongDate)
end
ifargs.isArchivedthen
result=cu.formatItem2(archived,original,ci.formatters.arArchive)
else
result=cu.formatItem(original,ci.formatters.arOffline)
end
end
returnresult
end

localfunctionmakeLanguageComment(args,result)
localok=true
ifcu.isSet(args.language)then
localparts=mw.text.split(args.language,' ')
fori=1,#parts,1do
parts[i]=mw.text.trim(parts[i]:gsub(',',''))
ifparts[i]:match('^%a%a%a?$')then
parts[i]=mw.language.fetchLanguageName(parts[i],
mw.language.getContentLanguage():getCode())
ifparts[i]==''then
ok=false
break
end
else
ok=false
break
end
end
ifokand#parts>0then
args.language=table.concat(parts,', ')
args.language=cu.formatItem(args.language,ci.formatters.addInLanguage)
end
end
result=result..cu.formatItem(args.language,ci.formatters.addLanguage)
result=cu.formatItem(result,ci.formatters.puAll)
ifcu.isSet(args.archiveUrl)orcu.isSet(args.originalUrl)
orargs.urlStatus=='usurped'then
result=result..makeArchived(args)
end
returnresult..cu.formatItem(args.quote,ci.formatters.addQuote)
..cu.formatItem(args.comment,ci.formatters.addComment)
end

localfunctionmakePublished(args)
localresult={}
makePublisher(args,result)
cu.insertItem(result,args.series,ci.formatters.tiSeries)
makeIsbn(args,result)
ifcu.isSet(args.chapter)andcu.isSet(args.chapterUrl)then
args.chapter=cu.makeLink(args.chapterUrl,args.chapter)
end
cu.insertItem(result,args.chapter,ci.formatters.tiChapter)
makePages(args,result)
if#result>0then
result={table.concat(result,ci.formatters.addDelimiter1)}
end

makeDoi(args,result)
makeWebInfo(args,result)
result=table.concat(result,ci.formatters.addDelimiter2)

returnmakeLanguageComment(args,result)
end

localfunctionmakeBook(args)
localauthor,title

ifargs.type=='book'orargs.type=='map'then
author=makeAuthor(args.author,args.editor)
title=makeTitle(args.title,args.volume,args.titleAddition,args.url,
args.scale,'title')
else-- bookitem
author=makeAuthor('',args.editor)
title=makeTitle(args.collection,args.volume,args.titleAddition,
args.url,'','bookitem')
end
returnauthor..title..makePublished(args)
end

localfunctionmakeCollection(args)
localauthor=makeAuthor(args.author,'')
localtitle=makeTitle(args.title,'','',args.url,'','title')
localeditor=makeAuthor('',args.editor)
localcollection=makeTitle(args.collection,args.volume,args.titleAddition,
args.siteUrl,'','bookitem')

returnauthor..title..ci.formatters.tiIn..editor..collection
..makePublished(args)
end

localfunctionmakeJournalTitle(args)
localtitle
ifargs.type=='journal'then
title=args.journal
elseifargs.type=='newspaper'then
title=args.newspaper
else
title=args.website
end
ifnotcu.isSet(title)then
ifargs.type~='web'orargs.type=='webnews'then
title=ci.texts.noTitle
cu.addErrorMsg(ci.texts.unknownPeriodical)
end
else
title=title:gsub("''+",'')-- remove multiple apostrophes
ifargs.type=='journal'then
title=cu.formatItem(title,ci.formatters.tiJournalTitle)
elseifargs.type=='newspaper'then
title=cu.formatItem(title,ci.formatters.tiNewspaperTitle)
else
title=cu.formatItem(title,ci.formatters.tiWebsiteTitle)
end
ifcu.isSet(args.siteUrl)then
title=cu.makeLink(args.siteUrl,title:gsub('[%[%]]',''))
end
title=ci.formatters.tiIn..title
..cu.formatItem(args.place,ci.formatters.prPlace)
..cu.formatItem(args.abbr,ci.formatters.prAbbr)
end
returntitle
end

localfunctionmakeJournalInfo(args,tab)
localyear=''
ifcu.isSet(args.date)then
year=cu.getDate(args.date,args.dateFormat,ci.texts.wrongDate)
end
localvolume=''
ifcu.isSet(args.volume)then
volume=cu.formatItem(args.volume,ci.formatters.prVolume)
ifcu.isSet(args.issue)then
volume=cu.formatItem2(volume,args.issue,ci.formatters.prVolIssue)
end
ifyear~=''then
volume=cu.formatItem2(volume,year,ci.formatters.prVolYear)
end
else
ifcu.isSet(args.issue)then
volume=cu.formatItem(args.issue,ci.formatters.prIssue)
ifyear~=''then
volume=cu.formatItem2(volume,year,ci.formatters.prVolYear)
end
else
volume=year
end
end
cu.insertItem(tab,volume)
end

localfunctionmakeNewspaperInfo(args,tab)
localday=''
ifcu.isSet(args.date)then
ifargs.dateFormat=='j. F Y'then
-- following result can be ''
day=cu.getDate(args.date,'l, j. F Y',ci.texts.wrongDate)
elseifargs.dateFormat=='M Y'orargs.dateFormat=='Y'then
day=cu.getDate(args.date,args.dateFormat,ci.texts.wrongDate)
else
cu.addErrorMsg(ci.texts.wrongDate)
end
end

day=cu.formatItem(day,ci.formatters.puDate)
cu.insertItem(tab,args.publisher)
cu.insertItem(tab,args.volume,ci.formatters.nsVolume)
cu.insertItem(tab,args.issue,ci.formatters.prIssue)
cu.insertItem(tab,day)
end

localfunctionmakePeriodical(args)
localauthor=makeAuthor(args.author,'')
..makeTitle(args.title,'',args.titleAddition,args.url,'','title')

localresult={}
localjTitle=makeJournalTitle(args)
cu.insertItem(result,jTitle)

makeIsbn(args,result)
ifargs.type=='journal'then
makeJournalInfo(args,result)
else-- newspaper and web
makeNewspaperInfo(args,result)
end
makePages(args,result)
makeDoi(args,result)
makeWebInfo(args,result)
if#result>0then
result[1]=mw.ustring.gsub(result[1],'^%l',mw.ustring.upper)
end
result=table.concat(result,ci.formatters.addDelimiter1)

returnauthor..makeLanguageComment(args,result)
end

localfunctionmakeCitation(frameArgs)
localargs=getValidArgs(frameArgs)
checkValues(args)

localcitation
ifargs.type=='map'orargs.type=='book'then
citation=makeBook(args)
elseifargs.type=='bookitem'then
citation=makeCollection(args)
elseifargs.type=='journal'orargs.type=='newspaper'
orargs.type=='web'orargs.type=='webnews'then
citation=makePeriodical(args)
else
args.type='book'
citation=ci.texts.wrongType..makeBook(args)
end

citation=cu.finalCleanup(citation)
ifcu.isSet(args.access)then
citation=citation
..' <span class= "voy-cite-access" >'
..ci.accessTypes[args.access].file..'</span>'
end
cc.prepareForCOinS(args)

returncu.getErrorMsgs()
..tostring(mw.html.create('cite')
:attr('class',ci.citeClass..ci.addCiteClasses[args.type])
:wikitext(citation)
)
..cc.makeCOinS(args)
end

functionct.citation(frame)
localfType=frame.args.type
localargs=frame:getParent().args

ifcu.isSet(fType)then
args.type=fType
else
args.type=cu.getKey(cu.getArgValue(ci.params,'type',args),ci.refTypes)
end
ifnotcu.isSet(args.type)then
ifcu.getArgValue(ci.params,'scale',args)~=''then
args.type='map'
elseifcu.getArgValue(ci.params,'collection',args)~=''then
args.type='bookitem'
elseifcu.getArgValue(ci.params,'journal',args)~=''then
args.type='journal'
elseifcu.getArgValue(ci.params,'newspaper',args)~=''then
args.type='newspaper'
elseifcu.getArgValue(ci.params,'website',args)~=''then
args.type='web'
else
args.type='book'
end
end
returncu.templateStyles(frame)..makeCitation(args)
end

returnct