Modul:Citation: Unterschied zwischen den Versionen
format -> prefix, doi; formatIdentifier
(OL) |
(format -> prefix, doi; formatIdentifier) |
||
| Zeile 2: | Zeile 2: | ||
local citation = { | local citation = { | ||
suite = 'Citation', | suite = 'Citation', | ||
serial = '2022-08- | serial = '2022-08-14', | ||
item = 56159597 | item = 56159597 | ||
} | } | ||
| Zeile 249: | Zeile 249: | ||
end | end | ||
local function | local function formatIdentifier( tab, key, urlPart, text, add ) | ||
if cu.isSet( url ) and cu.isSet( text ) then | |||
if ignoreError ~= 'true' | text = ci.params[ key ].prefix .. | ||
cu.makeLink( ci.params[ key ].url:gsub( '%%s', urlPart ), text ) .. | |||
( add or '' ) | |||
teble.insert( tab, text ) | |||
end | |||
end | |||
local function addIssn( tab, issn, ignoreError ) | |||
if cu.isSet( issn ) then | |||
local add = ignoreError ~= 'true' and ci.texts.wrongIssn or '' | |||
add = cx.check_issn( { args = { [ 1 ] = issn, error = add } } ) | |||
formatIdentifier( tab, 'issn', issn, issn, add ) | |||
end | end | ||
end | end | ||
| Zeile 343: | Zeile 351: | ||
li._linkISBNSet( { isbn = args.isbn, ignoreError = args.ignoreError } ) ) | li._linkISBNSet( { isbn = args.isbn, ignoreError = args.ignoreError } ) ) | ||
elseif cu.isSet( args.dnb ) then | elseif cu.isSet( args.dnb ) then | ||
formatIdentifier( tab, 'dnb', args.dnb, args.dnb ) | |||
elseif cu.isSet( args.oclc ) then | elseif cu.isSet( args.oclc ) then | ||
formatIdentifier( tab, 'oclc', args.oclc, args.oclc ) | |||
elseif cu.isSet( args.ol ) then | elseif cu.isSet( args.ol ) then | ||
local prefix = { | local prefix = { | ||
| Zeile 352: | Zeile 360: | ||
W = 'works/OL' | W = 'works/OL' | ||
}; | }; | ||
formatIdentifier( tab, 'ol', prefix[ args.ol:sub( -1 ) ] .. args.ol, args.ol ) | |||
elseif cu.isSet( args.asin ) then | elseif cu.isSet( args.asin ) then | ||
formatIdentifier( tab, 'asin', args.asin, args.asin ) | |||
end | end | ||
addIssn( tab, args.issn, args.ignoreError ) | |||
addIssn( tab, args.eissn, args.ignoreError ) | |||
end | end | ||
| Zeile 381: | Zeile 385: | ||
end | end | ||
if cu.isSet( args.doi ) then | if cu.isSet( args.doi ) then | ||
formatIdentifier( tab, 'doi', cu.encodeHandle( args.doi ), args.doi ) | |||
elseif cu.isSet( args.hdl ) then | elseif cu.isSet( args.hdl ) then | ||
formatIdentifier( tab, 'hdl', cu.encodeHandle( args.hdl ), args.hdl ) | |||
else | else | ||
-- JSTOR = doi:10.2307 | -- JSTOR = doi:10.2307 | ||
formatIdentifier( tab, 'jstor', args.jstor, args.jstor ) | |||
end | end | ||
formatIdentifier( tab, 'pmid', args.pmid, args.pmid ) | |||
end | end | ||