« Module:Biblio/Références » : différence entre les versions

Contenu supprimé Contenu ajouté
Remaniement affichage des liens externe (sans afficher le n°) ; indicationDeFormat : accepte les extensions de 3 lettres suivi d'une précision (ex: pdf 6 Mo)
databaseExterne et toutes les fonctions qui l'appelle : Retour à la version Base Numéro dans la base ; affichageLiensExternes : simplification associées
Ligne 134 :
 
 
local function databaseExterne( lienExterne, num, lienInternelienIinterne, texteAffichelienExterne, complement, texteAffiche )
if Outils.notEmpty( num ) then
local adresse =
lienIinterne
.. '&nbsp;<span class="plainlinks noarchive nowrap">[http://'
.. lienExterne
.. num
.. ( complement or ' ' )
.. ' ' .. ( texteAffiche or lienInternenum )
.. ']<sup/span>[['
.. lienInterne
.. '|?]]</sup></span>'
return adresse
Ligne 166 :
 
function References.oclc( oclc )
return databaseExterne( 'worldcat.org/oclc/', oclc, '[[Online Computer Library Center|OCLC]]', 'OCLCworldcat.org/oclc/', '&lang=fr ' )
end
 
Ligne 174 :
local texte = bnf
local category = ''
local bnfId = bnf:lowerupper():match( 'BNF(%d+%w)' ) or bnf:lower():match( 'cb(%d+%w)' ) or bnf:match( '^%d+%w' )
or bnf:lower():match( 'cb(%d+%w)' )
or bnf:match( '^%d+%w' )
if bnfId then
Ligne 201 ⟶ 199 :
-- dans tout les cas ou renvoir l'adresse, on catégorise juste pour vérifier ce qui ne va pas.
local lien = databaseExterne( 'catalogue.bnf.fr/ark:/12148/cb',
'notice [[Bibliothèque nationale de France|BnF]] n<sup>o</sup>',
bnf,
'catalogue.bnf.fr/ark:/12148/cb',
'Bibliothèque nationale de France',
'notice/PUBLIC BnFFRBNF',
'/PUBLIC'texte
)
Ligne 218 ⟶ 216 :
 
function References.lccn( lccn )
return databaseExterne( 'lccn.loc.gov/', lccn, '[[Numéro de contrôle de la Bibliothèque du Congrès|LCCN]]', 'LCCNlccn.loc.gov/' )
end
 
function References.dnb( dnb )
return databaseExterne( 'd-nb.info/', dnb, '[[Bibliothèque nationale allemande|DNB]]', 'DNBd-nb.info/' )
end
 
function References.jstor( jstor )
return databaseExterne( jstor, '[[JSTOR]]', 'jstor.org/stable/', jstor, 'JSTOR' )
end
 
function References.pmid( pmid )
return databaseExterne( pmid, '[[PubMed|PMID]]', 'www.ncbi.nlm.nih.gov/pubmed/', pmid, 'PubMed' )
end
 
function References.pmcid( pmcid )
return databaseExterne( pmcid, '[[PubMed Central|PMCID]]', 'www.ncbi.nlm.nih.gov/pmc/articles/', pmcid, 'PubMed Central' )
end
 
function References.doi( doi )
return databaseExterne( 'dx.doi.org/', doi, '[[Digital Object Identifier|DOI]]', 'DOIdx.doi.org/' )
end
 
function References.bibcode( bibcode )
return databaseExterne( bibcode, '[[Bibcode]]', 'adsabs.harvard.edu/abs/', bibcode, 'Bibcode' )
end
 
function References.mathreviews( mathreviews )
return databaseExterne( mathreviews, '[[Mathematical Reviews|Math Reviews]]', 'www.ams.org/mathscinet-getitem?mr=', mathreviews, 'Mathematical Reviews', 'Math Reviews' )
end
 
function References.zbl( zbl )
return databaseExterne( 'zbmath.org/?q=an:', zbl, '[[Zentralblatt MATH|zbMATH]]', 'zbMATHzbmath.org/?q=an:' )
end
 
function References.arxiv( arxiv )
return databaseExterne( arxiv, '[[arXiv]]', 'fr.arxiv.org/abs/', arxiv, 'arXiv' )
end
 
Ligne 301 ⟶ 299 :
local liensExternes = TableBuilder.new( )
local separateur = ', '
-- isbn et issn
liensExternes.minsert( References.isbn( args, validArg ), References.issn( args, validArg ) )
if validArg( 'isbn3', 'issn3', 'ISBN3', 'ISSN3' ) then
separateur = ' ; '
end
liensExternes.minsert( 'lien ' .. liens[1] )
local liens = TableBuilder.new( )
liens.minsert(
References.oclc( args.oclc ),
References.bnf ( args.bnf ),
Ligne 325 ⟶ 318 :
References.wikisource( args.wikisource )
)
if #liens == 1 then
liensExternes.minsert( 'lien ' .. liens[1] )
elseif #liens > 1 then
liensExternes.minsert( 'liens ' .. mw.text.listToText( liens ) )
if #liens > 2 then
separateur = ' ; '
end
end
if lireEnLigne then
Ligne 369 ⟶ 353 :
consult = string.sub( consult, 1, -2)
end
if (string.match(consult, '^.*-[ /-].*-[ /-].*')) then
consulteLe = 'consulté le '
else
Ligne 379 ⟶ 363 :
if #liensExternes > 0 then
return ' <small style="line-height:1em;">(' .. liensExternes.concat( separateur', ' ), ')</small>'
end
-- end