Module:Transcluder/doc/fr

From Northumberland Climbing
Jump to navigation Jump to search

<languages />

warning 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 page
  • get( '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 fichiers
  • get( 'Title#Section', { files = 1 } ) — Exclure tous les fichiers à l'exception du premier
  • get( 'Title#Section', { files = 2 } ) — Exclure tous les fichiers sauf le second
  • get( 'Title#Section', { files = '1,2' } ) — Exclude all files except the first and second
  • get( 'Title#Section', { files = '1-3' } ) — Exclude all files except the first, second and third
  • get( 'Title#Section', { files = '1,3-5' } ) — Exclude all files except the first, third, fourth and fifth
  • get( 'Title#Section', { files = -2 } ) — Exclure le second fichier
  • get( 'Title#Section', { files = '-2,3' } ) — Exclude the second and third files
  • get( 'Title#Section', { files = '-1,3-5' } ) — Exclude the first, third, fourth and fifth files
  • get( 'Title#Section', { files = 'A.png' } ) — Exclude all files except A.png
  • get( 'Title#Section', { files = '-A.png' } ) — Exclure A.png
  • get( 'Title#Section', { files = 'A.png, B.jpg, C.gif' } ) — Exclude all files except A.png, B.jpg and C.gif
  • get( 'Title#Section', { files = '-A.png, B.jpg, C.gif' } ) — Exclude A.png, B.jpg and C.gif
  • get( 'Title#Section', { files = { [1] = true, [3] = true } } ) — Exclude all files except the first and third
  • get( 'Title#Section', { files = { [1] = false, [3] = false } } ) — Exclure le premier et le troisième fichier
  • get( 'Title#Section', { files = { ['A.png'] = false, ['B.jpg'] = false } } ) — Exclure A.png et B.jpg
  • get( '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 first
  • get( '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 third
  • get( 'Title#Section', { references = 0 } ) — Exclure toutes les références
  • get( 'Title#Section', { categories = '0' } ) — Exclure toutes les catégories
  • get( 'Title#Section', { templates = '-.+infobox' } ) — Exclure les modèles de boîtes d'information
  • get( '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 fichiers
  • get( 'Title#Section', { only = 'lists', lists = 1 } ) — Obtenir que la première liste
  • get( '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 paragraph
  • get( 'Title#Section', { only = 'templates', templates = 'Infobox' } ) — Obtenir seulement la boîte d'information
  • get( '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 redirections
  • get( 'Title#Section', { linkBold = true } ) — Link the bold title or synonym near the start of the text
  • get( 'Title#Section', { noBold = true } ) — Enlever le texte en gras
  • get( 'Title#Section', { noSelfLinks = true } ) — Remove self links
  • get( '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

Voir aussi