Modul:Citation: Unterschied zwischen den Versionen

K
173 Versionen von wikivoyage:Modul:Citation importiert
(urn/doi/hdl)
K (173 Versionen von wikivoyage:Modul:Citation importiert)
 
(8 dazwischenliegende Versionen von einem anderen Benutzer werden nicht angezeigt)
Zeile 2: Zeile 2:
local citation = {
local citation = {
suite  = 'Citation',
suite  = 'Citation',
serial = '2022-08-17',
serial = '2022-10-21',
item  = 56159597
item  = 56159597
}
}


-- module import
-- module import
require( 'Module:No globals' )
-- require( 'strict' )
local cu = require( 'Module:Citation/utilities' )
local cu = require( 'Module:Citation/utilities' )
local cc = require( 'Module:Citation/COinS' )
local cc = require( 'Module:Citation/COinS' )
Zeile 77: Zeile 77:
if cu.isSet( args.title ) then
if cu.isSet( args.title ) then
args.title = args.title:gsub( '%s*%.+$', '' )
args.title = args.title:gsub( '%s*%.+$', '' )
end
-- convert book with chapter to collection
if args.type == 'book' and not cu.isSet( args.collection ) and cu.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
end


Zeile 230: Zeile 237:


if not cu.isSet( args.url ) then
if not cu.isSet( args.url ) then
for _, key in ipairs( { 'urn', 'doi', 'hdl' } ) do
for _, key in ipairs( ci.additionalTitleUrls ) do
if cu.isSet( args[ key ] ) then
if cu.isSet( args[ key ] ) then
args.url = ci.params[ key ].url:format( args[ key ] )
args.url = ci.params[ key ].url:format( args[ key ] )
Zeile 554: Zeile 561:
cu.insertItem( result, args.series, ci.formatters.tiSeries )
cu.insertItem( result, args.series, ci.formatters.tiSeries )
makeIsbn( args, result )
makeIsbn( args, result )
if cu.isSet( args.chapter ) and cu.isSet( args.chapterUrl ) then
args.chapter = cu.makeLink( args.chapterUrl, args.chapter )
end
cu.insertItem( result, args.chapter, ci.formatters.tiChapter )
cu.insertItem( result, args.chapter, ci.formatters.tiChapter )
makePages( args, result )
makePages( args, result )
Zeile 716: Zeile 726:
if cu.isSet( args.access ) then
if cu.isSet( args.access ) then
citation = citation
citation = citation
.. '&nbsp;<span style="position:relative; top: -2px;">'
.. '&nbsp;<span class="voy-cite-access">'
.. ci.accessTypes[ args.access ].file .. '</span>'
.. ci.accessTypes[ args.access ].file .. '</span>'
end
end