Modul:Citation: Unterschied zwischen den Versionen
+span-Tags
K (Korrektur) |
(+span-Tags) |
||
| Zeile 2: | Zeile 2: | ||
local citation = { | local citation = { | ||
suite = 'Citation', | suite = 'Citation', | ||
serial = ' | serial = '2021-01-09', | ||
} | } | ||
| Zeile 194: | Zeile 194: | ||
-- make author part | -- make author part | ||
local function makeAuthor( author, editor ) | local function makeAuthor( author, editor ) | ||
author = cu.formatItem( author, ci.formatters.auAuthor ) | |||
editor = cu.formatItem( editor, ci.formatters.auEditor ) | editor = cu.formatItem( editor, ci.formatters.auEditor ) | ||
if cu.isSet( author ) and cu.isSet( editor ) then | if cu.isSet( author ) and cu.isSet( editor ) then | ||
| Zeile 200: | Zeile 201: | ||
author = editor | author = editor | ||
end | end | ||
return cu.formatItem( author, ci.formatters. | return cu.formatItem( author, ci.formatters.auAuthorAll ) | ||
end | end | ||
-- make title part | -- make title part | ||
local function makeTitle( title, volume, addition, url, scale ) | local function makeTitle( title, volume, addition, url, scale, titleType ) | ||
if titleType == 'collection' then | |||
title = cu.formatItem( title, ci.formatters.tiCollectionTitle ) | |||
elseif titleType == 'journal' then | |||
title = cu.formatItem( title, ci.formatters.tiJournalTitle ) | |||
else | |||
title = cu.formatItem( title, ci.formatters.tiTitle ) | |||
end | |||
if not cu.isSet( title ) then | if not cu.isSet( title ) then | ||
title = ci.texts.noTitle | title = ci.texts.noTitle | ||
| Zeile 217: | Zeile 225: | ||
if cu.isSet( volume ) then | if cu.isSet( volume ) then | ||
title = cu.formatItem2( title, volume, ci.formatters.tiVolume ) | title = cu.formatItem2( title, volume, ci.formatters.tiVolume ) | ||
end | end | ||
if cu.isSet( addition ) then | if cu.isSet( addition ) then | ||
| Zeile 247: | Zeile 253: | ||
end | end | ||
if cu.isSet( | local place = cu.formatItem( args.place, ci.formatters.puPlace ) | ||
published = cu.formatItem2( | local publisher = cu.formatItem( args.publisher, ci.formatters.puPublisher ) | ||
elseif cu.isSet( | if cu.isSet( place ) and cu.isSet( publisher ) then | ||
published = | published = cu.formatItem2( place, publisher, ci.formatters.puPlacePub ) | ||
elseif cu.isSet( | elseif cu.isSet( place ) then | ||
published = | published = place | ||
elseif cu.isSet( publisher ) then | |||
published = publisher | |||
end | end | ||
theDate = cu.formatItem( theDate, ci.formatters.puDate ) | |||
if not cu.isSet( published ) then | if not cu.isSet( published ) then | ||
published = theDate | published = theDate | ||
| Zeile 431: | Zeile 441: | ||
if args.type == 'book' or args.type == 'map' then | if args.type == 'book' or args.type == 'map' then | ||
author = makeAuthor( args.author, args.editor ) | author = makeAuthor( args.author, args.editor ) | ||
title = makeTitle( args.title, args.volume, args.titleAddition, args.url, args.scale ) | title = makeTitle( args.title, args.volume, args.titleAddition, args.url, | ||
args.scale, 'title' ) | |||
else -- collection | else -- collection | ||
author = makeAuthor( '', args.editor ) | author = makeAuthor( '', args.editor ) | ||
title = makeTitle( args.collection, args.volume, args.titleAddition, args.url, '' ) | title = makeTitle( args.collection, args.volume, args.titleAddition, | ||
args.url, '', 'collection' ) | |||
end | end | ||
return author .. title .. makePublished( args ) | return author .. title .. makePublished( args ) | ||
| Zeile 441: | Zeile 453: | ||
local function makeCollection( args ) | local function makeCollection( args ) | ||
local author = makeAuthor( args.author, '' ) | local author = makeAuthor( args.author, '' ) | ||
local title = makeTitle( args.title, '', '', args.url, '' ) | local title = makeTitle( args.title, '', '', args.url, '', 'title' ) | ||
local editor = makeAuthor( '', args.editor ) | local editor = makeAuthor( '', args.editor ) | ||
local collection = makeTitle( args.collection, args.volume, args.titleAddition, args.siteUrl, '' ) | local collection = makeTitle( args.collection, args.volume, args.titleAddition, | ||
args.siteUrl, '', 'collection' ) | |||
return author .. title .. ci.formatters.tiIn .. editor .. collection | return author .. title .. ci.formatters.tiIn .. editor .. collection | ||
| Zeile 465: | Zeile 478: | ||
else | else | ||
title = title:gsub( "''+", '' ) -- remove multiple apostrophes | title = title:gsub( "''+", '' ) -- remove multiple apostrophes | ||
title = cu.formatItem( title, ci.formatters. | title = cu.formatItem( title, ci.formatters.tiJournalTitle ) | ||
if cu.isSet( args.siteUrl ) then | if cu.isSet( args.siteUrl ) then | ||
title = cu.makeLink( args.siteUrl, title:gsub( '[%[%]]', '' ) ) | title = cu.makeLink( args.siteUrl, title:gsub( '[%[%]]', '' ) ) | ||
| Zeile 522: | Zeile 535: | ||
local function makePeriodical( args ) | local function makePeriodical( args ) | ||
local author = makeAuthor( args.author, '' ) | local author = makeAuthor( args.author, '' ) | ||
.. makeTitle( args.title, '', args.titleAddition, args.url, '' ) | .. makeTitle( args.title, '', args.titleAddition, args.url, '', 'title' ) | ||
local result = {} | local result = {} | ||