Moduulin Fr:Biblio käyttöohje
Tämä sivu on kopio. Tätä ohjetta muokataan muokkaamalla suomenkielisessä Wikipediassa olevaa alkuperäistä versiota jonka muutokset kopioituvat automaattisesti tälle sivulle. Tämä moduuli on osa ranskankielisestä Wikipediasta kopioitua Wikidata ja Interface Wikidata -moduulikokonaisuutta (ks. ohjeet ja esimerkit). Listauksen kaikista tähän liittyvistä moduuleista löydät Ranskankielisen Wikipedian Wikidata-moduulit -sivulta.
|
-- Mallinen Fr:Biblio yhdistää bibliografioille ja viitteille hyödyllisiä toimintoja.
local Biblio = { }
require('strict')
local Outils = require( 'Module:Fr:Outils' )
Biblio.ouvrage = function ( frame )
local args = Outils.extractArgs( frame )
local Ouvrage = require( 'Module:Fr:Biblio/Ouvrage' )
return Ouvrage.ouvrage( args )
end
Biblio.chapitre = function ( frame )
local args = Outils.extractArgs( frame )
local Ouvrage = require( 'Module:Fr:Biblio/Ouvrage' )
return Ouvrage.chapitre( args )
end
Biblio.article = function ( frame )
local args = Outils.extractArgs( frame )
local Ouvrage = require( 'Module:Fr:Biblio/Article' )
return Ouvrage.article( args )
end
Biblio.lienWeb = function( frame )
local args = Outils.extractArgs( frame )
local Ouvrage = require( 'Module:Fr:Biblio/Lien web' )
return Ouvrage.lienWeb( args )
end
Biblio.lienBrise = function( frame )
local args = Outils.extractArgs( frame )
local Ouvrage = require( 'Module:Biblio/Lien web' )
return Ouvrage.lienBrise( args )
end
Biblio.dictionnaire = function( frame )
local args = Outils.extractArgs( frame )
local article = Outils.validTextArg( args, 'huom', 'artikkeli', 'luvun otsikko' )
local Ouvrage = require( 'Module:Fr:Biblio/Ouvrage' )
if article then
args = article
return Ouvrage.chapitre( args )
else
args.titre = args
args = args
args.auteur1 = args
args.auteurs = args
return Ouvrage.ouvrage( args )
end
end
-- catégorise une page en fonction du namespace
local function categorise(args)
local namespaceCategorisation = { = true, = true, = true, = true, = true, = true, = true }
local category = args
local flag = args
if type(category) == 'string'
and flag
and namespaceCategorisation
then
return ']'
end
return ''
end
Biblio.ISBN = function ( frame )
local args = Outils.extractArgs( frame )
if Outils.trim( args ) then
local newArgs = { isbn = args }
local i = 2
while args do
newArgs = args
i = i + 1
end
return Biblio.identifiantsBiblio( newArgs )
else
return '<small>(Tuntematon ] )</small>' .. categorise{ 'Puuttuva ISBN', true }
end
end
Biblio.rechercheIsbn = function( frame )
local args = Outils.extractArgs( frame )
local References = require( 'Module:Fr:Biblio/Références' )
local newArgs = { isbn = args, sansLabel = true, categ = {} }
local isbn = References.isbn( newArgs ) or ''
local categ = categorise{ 'Teos, jolla on epäkelpo ISBN', newArgs.categ.isbnInvalid }
return isbn .. categ
end
Biblio.EAN = function ( frame )
local args = Outils.extractArgs( frame )
if Outils.trim( args ) then
local newArgs = { ean = args, categ = {} }
local i = 2
while args do
newArgs = args
i = i + 1
end
return Biblio.identifiantsBiblio( newArgs )
else
return '<small>(Tuntematon ])</small>]'
end
end
Biblio.ISSN = function ( frame )
local args = Outils.extractArgs( frame )
if Outils.trim( args ) then
local newArgs = { issn = args, categ = {} }
local i = 2
while args do
newArgs = args
i = i + 1
end
return Biblio.identifiantsBiblio( newArgs )
else
return '<small>(Tuntematon ])</small>' .. categorise{ 'Puuttuva ISSN', true }
end
end
Biblio.rechercheIssn = function( frame )
local args = Outils.extractArgs( frame )
local References = require( 'Module:Fr:Biblio/Références' )
local newArgs = { issn = args, sansLabel = true, categ = {} }
local issn = References.issn( newArgs ) or ''
local categ = categorise{ 'Sivulla epäkelpo ISSN', newArgs.categ.issnInvalid }
return issn .. categ
end
Biblio.BNF = function ( frame )
local References = require( 'Module:Biblio/Références' )
return References.bnf( Outils.extractArgs( frame ) )
end
Biblio.enLigne = function ( frame )
local args = Outils.extractArgs( frame )
local References = require( 'Module:Fr:Biblio/Références' )
return '<small></small>'
end
Biblio.identifiantsBiblio = function( frame )
local args = Outils.extractArgs( frame )
args.categ = {}
local References = require( 'Module:Fr:Biblio/Références' )
return References.affichageLiensExternes( args, nil, true, true )
.. categorise{ 'Teoksella epäkelpo ISBN', args.categ.isbnInvalid }
.. categorise{ 'Sivulla epäkelpo ISSN', args.categ.issnInvalid }
.. categorise{ 'Sivulla epäkelpo EAN', args.categ.eanInvalid }
end
return Biblio