« Module:Biblio » : différence entre les versions

De Lagny-sur-Marne Wiki
Aller à la navigation Aller à la recherche
0x010D (discussion | contributions)
Ajout dictionnaire,
0x010D (discussion | contributions)
dictionnaire : ajout auteur(s) ouvrage ; toutes fonctions : correction paramètres de Outils.extractArgs.
Ligne 8 : Ligne 8 :


Biblio.ouvrage = function ( frame )
Biblio.ouvrage = function ( frame )
     local args = Outils.extractArgs( frame, 'titre' )
     local args = Outils.extractArgs( frame )
     local Ouvrage = require( 'Module:Biblio/Ouvrage' )
     local Ouvrage = require( 'Module:Biblio/Ouvrage' )
     return Ouvrage.ouvrage( args )  
     return Ouvrage.ouvrage( args )  
Ligne 15 : Ligne 15 :


Biblio.chapitre = function ( frame )
Biblio.chapitre = function ( frame )
     local args = Outils.extractArgs( frame, 'titre', 'titre chapitre', 'titre ouvrage' )
     local args = Outils.extractArgs( frame )
     local Ouvrage = require( 'Module:Biblio/Ouvrage' )
     local Ouvrage = require( 'Module:Biblio/Ouvrage' )
     return Ouvrage.chapitre( args )  
     return Ouvrage.chapitre( args )  
Ligne 22 : Ligne 22 :


Biblio.article = function ( frame )
Biblio.article = function ( frame )
     local args = Outils.extractArgs( frame, 'titre', 'périodique', 'année' )
     local args = Outils.extractArgs( frame )
     local Ouvrage = require( 'Module:Biblio/Article' )
     local Ouvrage = require( 'Module:Biblio/Article' )
     return Ouvrage.article( args )  
     return Ouvrage.article( args )  
Ligne 29 : Ligne 29 :


Biblio.lienWeb = function( frame )
Biblio.lienWeb = function( frame )
     local args = Outils.extractArgs( frame, 'url', 'titre', 'title' )
     local args = Outils.extractArgs( frame )
     local Ouvrage = require( 'Module:Biblio/Lien web' )
     local Ouvrage = require( 'Module:Biblio/Lien web' )
     return Ouvrage.lienWeb( args )  
     return Ouvrage.lienWeb( args )  
Ligne 45 : Ligne 45 :
args.titre = args['titre ouvrage']
args.titre = args['titre ouvrage']
args['sous-titre'] = args['sous-titre ouvrage']
args['sous-titre'] = args['sous-titre ouvrage']
args.auteur1 = args['auteur ouvrage']
args.auteurs = args['auteurs ouvrage']
return Ouvrage.ouvrage( args )
return Ouvrage.ouvrage( args )
end
end
Ligne 51 : Ligne 53 :


Biblio.ISBN = function ( frame )
Biblio.ISBN = function ( frame )
     local args = Outils.extractArgs( frame, 'isbn', 'ISBN', 'iSbn1', 'ISBN1' )
     local args = Outils.extractArgs( frame )
     local References = require( 'Module:Biblio/Références' )
     local References = require( 'Module:Biblio/Références' )
     return '<small>(' .. References.ISBN( args ) .. ')</small>'
     return '<small>(' .. References.ISBN( args ) .. ')</small>'
Ligne 58 : Ligne 60 :


Biblio.ISSN = function ( frame )
Biblio.ISSN = function ( frame )
     local args = Outils.extractArgs( frame, 'issn', 'ISSN', 'issn1', 'ISSN1' )
     local args = Outils.extractArgs( frame )
     local References = require( 'Module:Biblio/Références' )
     local References = require( 'Module:Biblio/Références' )
     return References.ISSN( args )  
     return References.ISSN( args )  
Ligne 65 : Ligne 67 :


Biblio.enLigne = function ( frame )
Biblio.enLigne = function ( frame )
     local args = Outils.extractArgs( frame, 'lien', 'url' )
     local args = Outils.extractArgs( frame )
     local References = require( 'Module:Biblio/Références' )
     local References = require( 'Module:Biblio/Références' )
     return '<small>[' .. References.enLigne( args )  .. ']</small>'
     return '<small>[' .. References.enLigne( args )  .. ']</small>'

Version du 3 octobre 2013 à 01:40

-- Le module biblio centralise les différentes fonctions utiles pour les bibliographie et références.

local Biblio = { }


local Outils = require( 'Module:Outils' )


Biblio.ouvrage = function ( frame )

   local args = Outils.extractArgs( frame )
   local Ouvrage = require( 'Module:Biblio/Ouvrage' )
   return Ouvrage.ouvrage( args ) 

end


Biblio.chapitre = function ( frame )

   local args = Outils.extractArgs( frame )
   local Ouvrage = require( 'Module:Biblio/Ouvrage' )
   return Ouvrage.chapitre( args ) 

end


Biblio.article = function ( frame )

   local args = Outils.extractArgs( frame )
   local Ouvrage = require( 'Module:Biblio/Article' )
   return Ouvrage.article( args ) 

end


Biblio.lienWeb = function( frame )

   local args = Outils.extractArgs( frame )
   local Ouvrage = require( 'Module:Biblio/Lien web' )
   return Ouvrage.lienWeb( args ) 

end


Biblio.dictionnaire = function( frame )

   local args = Outils.extractArgs( frame )
   local article = Outils.validTextArg( args, 'notice', 'article', 'titre chapitre' )
   local Ouvrage = require( 'Module:Biblio/Ouvrage' )

if article then args['titre chapitre'] = article return Ouvrage.chapitre( args ) else args.titre = args['titre ouvrage'] args['sous-titre'] = args['sous-titre ouvrage'] args.auteur1 = args['auteur ouvrage'] args.auteurs = args['auteurs ouvrage'] return Ouvrage.ouvrage( args ) end end


Biblio.ISBN = function ( frame )

   local args = Outils.extractArgs( frame )
   local References = require( 'Module:Biblio/Références' )
   return '(' .. References.ISBN( args ) .. ')'

end


Biblio.ISSN = function ( frame )

   local args = Outils.extractArgs( frame )
   local References = require( 'Module:Biblio/Références' )
   return References.ISSN( args ) 

end


Biblio.enLigne = function ( frame )

   local args = Outils.extractArgs( frame )
   local References = require( 'Module:Biblio/Références' )
   return '[' .. References.enLigne( args )  .. ']'

end


return Biblio