Difference between revisions of "Module:Transcluder/doc/fr"
module>FuzzyBot (Updating to match new version of source page) |
m (1 revision imported) |
(No difference)
|
Latest revision as of 05:53, 31 July 2020
<languages />
Warning: | Do not edit. This page is maintained by an automated tool. All edits should be done at mediawiki.org. (translate this warning) Please help translate this page. |
Ce module est un moteur de transclusion à but général, capable de transclure toute partie d'une page quelconque et avec de nombreuses options non fournies par la transclusion standard.
Utilisation
Modules
Le point d'entrée principal pour les modules est la méthode get
.
get( 'Title' )
— Get the requested page (exact same result as normal transclusion)get( 'Title#' )
— Get the lead section of the requested pageget( 'Title#Section' )
— Get the requested section or<section>
tag (includes any subsections)
<noinclude>
and <onlyinclude>
tags are handled the usual way and there's also an optional second parameter to exclude various elements from the result:
get( 'Title#Section', { files = 0 } )
— Exclure tous les fichiersget( 'Title#Section', { files = 1 } )
— Exclure tous les fichiers à l'exception du premierget( 'Title#Section', { files = 2 } )
— Exclure tous les fichiers sauf le secondget( 'Title#Section', { files = '1,2' } )
— Exclude all files except the first and secondget( 'Title#Section', { files = '1-3' } )
— Exclude all files except the first, second and thirdget( 'Title#Section', { files = '1,3-5' } )
— Exclude all files except the first, third, fourth and fifthget( 'Title#Section', { files = -2 } )
— Exclure le second fichierget( 'Title#Section', { files = '-2,3' } )
— Exclude the second and third filesget( 'Title#Section', { files = '-1,3-5' } )
— Exclude the first, third, fourth and fifth filesget( 'Title#Section', { files = 'A.png' } )
— Exclude all files except A.pngget( 'Title#Section', { files = '-A.png' } )
— Exclure A.pngget( 'Title#Section', { files = 'A.png, B.jpg, C.gif' } )
— Exclude all files except A.png, B.jpg and C.gifget( 'Title#Section', { files = '-A.png, B.jpg, C.gif' } )
— Exclude A.png, B.jpg and C.gifget( 'Title#Section', { files = { [1] = true, [3] = true } } )
— Exclude all files except the first and thirdget( 'Title#Section', { files = { [1] = false, [3] = false } } )
— Exclure le premier et le troisième fichierget( 'Title#Section', { files = { ['A.png'] = false, ['B.jpg'] = false } } )
— Exclure A.png et B.jpgget( 'Title#Section', { files = '.+%.png' } )
— Exclude all files except PNG files (see Lua patterns)get( 'Title#Section', { files = '-.+%.png' } )
— Exclure tous les fichiers PNG.
The very same syntax can be used to exclude many other elements:
get( 'Title#Section', { sections = 0 } )
— Exclure toutes les sous-sections.get( 'Title#Section', { sections = 'History, Causes' } )
— Exclude all subsections except 'History' and 'Causes'get( 'Title#Section', { lists = 1 } )
— Exclude all lists except the firstget( 'Title#Section', { tables = 'stats' } )
— Exclude all tables except the one with id 'stats'get( 'Title#Section', { paragraphs = '1-3' } )
— Exclude all paragraphs except the first, second and thirdget( 'Title#Section', { references = 0 } )
— Exclure toutes les référencesget( 'Title#Section', { categories = '0' } )
— Exclure toutes les catégoriesget( 'Title#Section', { templates = '-.+infobox' } )
— Exclure les modèles de boîtes d'informationget( 'Title#Section', { parameters = 'image' } )
— Exclure tous les paramètres de tous les modèles sauf le paramètre 'image'
Les options peuvent être combinées à volonté. Par exemple :
get( 'Title#Section', { sections = 0, files = 1, paragraphs = '1-3' } )
— Exclude all subsections, all files except the first, and all paragraphs except the first three
Vous pouvez également n'obtenir que quelques éléments de la manière suivante :
get( 'Title#Section', { only = 'files' } )
— Obtenir que les fichiersget( 'Title#Section', { only = 'lists', lists = 1 } )
— Obtenir que la première listeget( 'Title#Section', { only = 'tables', tables = 'stats' } )
— Obtenir seulement la table avec l'ID 'stats'get( 'Title#Section', { only = 'paragraphs', paragraphs = '1,3-5' } )
— Get only the first, third, fourth and fifth paragraphget( 'Title#Section', { only = 'templates', templates = 'Infobox' } )
— Obtenir seulement la boîte d'informationget( 'Title#Section', { only = 'files, lists', files = 1 } )
— Obtenir seulement le premier fichier, suivi de toutes les listes
The output can be further modified with a few special options:
get( 'Title#Section', { noFollow = true } )
— Ne pas suivre les redirectionsget( 'Title#Section', { linkBold = true } )
— Link the bold title or synonym near the start of the textget( 'Title#Section', { noBold = true } )
— Enlever le texte en grasget( 'Title#Section', { noSelfLinks = true } )
— Remove self linksget( 'Title#Section', { noBehaviorSwitches = true } )
— Remove behavior switches such as__NOTOC__
get( 'Title#Section', { fixReferences = true } )
— Prefix reference names with 'Title ' to avoid name conflicts when transcluding and rescue references defined outside the requested section to avoid undefined reference errors
Besides the get
method, the module exposes several other methods to get specific parts of the wikitext.
This allows other modules to combine elements in more advanced ways.
Modèles
The main entry point for templates is the main
method.
It's essentially a wrapper of the get
method to make it usable for templates.
See the documentation of the get
method for more details and options.
{{#invoke:Transcluder|main|Title}}
— Transclure la page demandée{{#invoke:Transcluder|main|Title#}}
— Transclude the lead section of the requested page{{#invoke:Transcluder|main|Title#Section}}
— Transclude the requested section or<section>
tag (includes any subsections){{#invoke:Transcluder|main|Title#Section|sections=0}}
— Transclude the requested section, excluding subsections{{#invoke:Transcluder|main|Title|only=files|files=1}}
— Transclude only the first file of the page{{#invoke:Transcluder|main|Title#Section|only=tables|tables=2}}
— Transclude only the second table of the requested section{{#invoke:Transcluder|main|Title#|only=paragraphs|linkBold=yes}}
— Transclude only the paragraphs of the lead section and link the bold text