Extension:Labeled Section Transclusion/fr

L'extension Labeled Section Transclusion permet la transclusion sélective de sections cochées, en faisant une analyse syntaxique wikitext normale. Sa fonctionnalité est similaire à une version améliorée de l'étiquette avec une transclusion wiki normale, laquelle selectionne des sections pour inclusion. Elle est disponible pour tous les wikis Wikimedia.

Tandis que la transclusion normale est destinée principalement à transclure de grandes portions de petits modèles, l'extension Labeled Section Transclusion est destinée pour petites portions de grandes pages.

Pourtant, il y a quelques différences. Dans la transclusion du modèle natif, les sections sont marquées par comportement; donc seules des sections (possiblement non adjacentes) peuvent être incluses ou omises.

Ici, les sections sont marqués par leur nom, et le comportement est choisi par l'appelant, lequel peut inclure ou omettre des sections selon besoin. nécessaire. Différentes pages peuvent inclure ou exclure des sections sélectionnées; il peut y avoir un nombre arbitraire de sections, qui peuvent aussi se chevaucher arbitrairement.

En marquant les sections avec un nom plutôt que d'après leur comportement, on peut modifier les liens de section pour les générer de manière plus adaptée pour l'extraction de plus grandes parties de texte, depuis que l'extension peut maintenant compter les sections embarquées au début de la page, permettant aux sections transcluses d'être indexées correctement.

Etape 1: marquage des sections
Marquez les sections du texte en utilisant les balises  comme ceci :

this is a chapter 1

Notez que ces balises ne sont pas du HTML/XML, et n'utilisent pas la syntaxe normale des attributs. Pour cette raison, et parce que les marqueurs begin et end sont dissociés plutôt que d'avoir des balises standard ouvrantes et fermantes XML, ceci permet d'avoir des sections imbriquées ou qui se recouvrent. Vous pouvez ainsi insérer des balises de section sans vous préoccuper de l'interférence avec les autres sections.

Etape 2a: transclure la section
Call the parser function #lst to transclude it, i.e. to transclude a section called chapter1 from a page called articleX:

The target article defines the location of the section; its behavior is determined by the parser function.

Etape 2b: transclure la page en excluant la section
Pour transclure une page, mais en excluant une section spécifique, utilisez la fonction #lstx :

Optionally, you may add replacement text to the excluded section.

Exemple:

The replacement text will appear in the area where the section is skipped (excluded).

Section discontinues
It is possible to have multiple sections with the same name; in this case, every section with that name will be included/excluded. This is especially useful to mark various discussions.

Eventail des sections
These functions have an additional, optional argument to specify a section range; i.e., to include everything from the beginning of chapter 1 to the end of chapter 3. This allows using empty marker pairs to mark one end of the section, possibly in a template. A similar mechanism is currently used at the French Wikisource.

Substitution
This also works with substitution; it's even possible for an article to substitute a section of itself. One use of this provides a neat way to archive talk pages: Mark the text to be archived using, etc. Then create an archive page with the text, using archive , which copies archived sections. Lastly, replace the contents of talk_page with archive to remove those sections.

Transclure les sections par le titre
There is optional support for transcluding sections of text marked with the normal headings, i.e. . If installed, this is done with the lsth function.

Transclure l'introduction
Pour transclure l'introduction d'une page (par exemple le contenu avant le premier titre), utilisez

Transclure une section spécifique
You can also transclude the whole content of the sectionX (which includes all its sub-sections but excludes the heading of sectionX itself).

Eléments à prendre en compte:


 * 1) Only the first occurrence of the sectionX is transcluded if you have more than one section with the same name.
 * 2) Make sure you type what the heading of sectionX is in wikitext, not how it is displayed. For example if the heading of the section is  , you should type " " not " ".
 * 3) When transcluding a section from a page marked for translation using the translate extension, transclude from the language-specific version. Par exemple, à partir de pagename/en plutôt que de pagename.
 * 4) The matching is case insensitive, to prevent links from breaking due to case changes.

Transclure plusieurs sections
You can also transclude from the first occurrence of sectionX (excluding the heading of sectionX itself) until it reaches the next occurrence of sectionY. Note that sectionY acts as a stop point so the transclusion doesn't contain the content of sectionY.

Notes concernant les titres sautés
Since the traditional transclusion in MediaWiki isn't intended to transclude sections, it doesn't account for skipped headings. As a result, if you were to transclude a template with multiple headings, and skip the first heading, then all of the edit sections links would point to the wrong section in the template.

When this extension is used (with MediaWiki 1.9 or later), the #lst and #lsth functions count headings in the "skipped" beginning part, and offset transcluded headings appropriately. This will allow these links to point to the correct section in the simple case.

Note that #lstx does not count skipped headings, and that skipped headings within discontiguous sections are not offset. '''But it seems it has been fixed now (likely when ported to MediaWiki's new preprocessor). The transcluded headings can be linked to the correct sections'''.

Internationalisation
Internally, the parser functions all use the lst prefix, for consistency with the name of the extension. Since this acronym may be confusing to non-developers, readable English variants have been introduced, so the functions can currently be called from either name.

Additionally, the tag can now be localised (currently English, German, and Hebrew), i.e.:


 *  ... 
 * (RTL): <קטע התחלה=א> ... <קטע סוף=א> ("start" code to the right and "end" code to the left)
 *  ...
 *  ...

Limitations

 * While it is possible to use this extension across namespaces, interwiki references are not resolved. It is not yet possible, for example, to include part of a Wikisource page into a remote MediaWiki installation.
 * Section tags cannot themselves be transcluded in order to work on other pages.  and   work only if section tags appear directly in the wikitext of the transcluded page. This means, for instance, that these tags cannot be embedded in a template using template parameters and parser functions. The   magic word does not work with section tags.   produces balanced tags, while the section tags uses singular tags. See.
 * As of 2014, section tags don't have any effect when used inside a template parameter. If page A contains a text, there's no way  can access X.

Installation
There is also a Gadget in use on various Wikisources that makes it possible to define sections with a simplified  syntax. Son code peut être trouvé sur Wikisource:MediaWiki:Gadget-Easy_LST.js.

Exemples

 * wikisource:user:sanbeg/Includer is an early demonstration that shows several of the basic features.

Voir aussi

 * DynamicPageList (third-party) includes a slightly modified built-in version of Labeled Section Transclusion