Extension:Labeled Section Transclusion/it

From mediawiki.org
This page is a translated version of the page Extension:Labeled Section Transclusion and the translation is 60% complete.
Outdated translations are marked like this.
Manuale sulle Estensioni MediaWiki
Labeled Section Transclusion
Stato della release: stabile
Implementazione Etichetta , Parser function
Descrizione Permette di transcludere le sezioni di testo contrassegnate
Autore(i) Steve Sanbeg
Politica di compatibilità Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki >= 1.42
Modifiche al Database No
Licenza GNU General Public License 2.0 or later
Scaricare
Public wikis using 6,919 (Ranked 26th)
Traduci l'estensione Labeled Section Transclusion se è disponibile su translatewiki.net
Problemi Compiti aperti · Riportare un bug

L'estensione Labeled Sezione Transclusion consente la transclusione selettiva di sezioni di testo delimitate, analizzando il wikitesto come un testo normale. La sua funzionalità è simile a una versione migliorata del tag ‎<onlyinclude> con la normale trasclusione wiki, che seleziona le sezioni da includere. È abilitato su tutti i wiki di Wikimedia

Mentre la transclusione normale è destinata principalmente a transcludere grandi porzioni di piccoli modelli, la transclusione di sezione etichettata è destinata a piccole porzioni di grandi pagine

Tuttavia, ci sono alcune differenze. Nella transclusione di modello nativo, le sezioni sono contrassegnate dal loro comportamento; quindi si può includere o saltare una sola sezione (possibilmente non contigua).

Here, sections are marked by name, and behavior is chosen by the caller, which can include or skip sections as needed. Different pages can include or exclude selected sections; there can be arbitrary numbers of sections, which can also overlap arbitrarily.

Marking sections by name rather than behavior allows edit section links to be rendered more appropriately for getting excerpts from larger texts, since the extension can now account for sections that are skipped in the beginning of the page, allowing transcluded sections to be offset appropriately.

Installazione

  • Download and move the extracted LabeledSectionTransclusion folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/LabeledSectionTransclusion
  • Aggiungi il seguente codice al tuo $LocalSettings (preferibilmente alla fine):
    wfLoadExtension( 'LabeledSectionTransclusion' );
    
  • Yes Done – Naviga in Special:Version nella tua wiki per verificare che l'estensione sia stata installata correttamente.

There is also a Gadget in use on Wikisource.org wikis that makes it possible to define sections with a simplified ## label ## syntax. Il suo codice si trova a Wikisource:MediaWiki:Gadget-Easy_LST.js.

Functions

Transcludi qualosiasi parte contrassegnata

Passo 1: Marchi le sezioni

Evidenzia le sezioni nel testo utilizzando i tag ‎<section> come questo:

<section begin="chapter1" />this is a chapter 1<section end="chapter1" />

Note that these tags are not HTML/XML, and do not use the normal attribute syntax. For this reason, and because the begin and end markers are individual, rather than normal XML open/close tags, this allows nested or overlapping sections. This allows you to insert section tags without worrying about interfering with other sections.

Fase 2a: Includere la sezione

Chiama la funzione di analisi #lst per transcluderlo, cioè per transcludere una sezione chiamata chapter1 da una pagina chiamata articleX:

{{#lst:articleX|chapter1}}

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

Fase 2b: Includere la pagina ma escludere la sezione

To transclude a page, but exclude a specified section, use the #lstx function:

{{#lstx:articleX|chapter1}}

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

{{#lstx:articleX|chapter1|replacement_text}}

Esempio:

{{#lstx:articleX|chapter1|See chapter 1 in [[articleX]].}}

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

Sezioni discontinue

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.

Section ranges

Queste funzioni hanno un argomento aggiuntivo facoltativo per specificare un intervallo di sezioni; cioè {{#lst:articleX|chapter1|chapter3}}, per includere tutto dall'inizio del capitolo 1 alla fine del capitolo 3. Ciò consente di utilizzare coppie di marcatori vuote per contrassegnare un'estremità della sezione, possibilmente in un modello. Un meccanismo simile è attualmente utilizzato in Wikisource francese.

Sostituzione

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 <section begin=archive />, etc. Then create an archive page with the text, using {{subst:#lst:talk_page|archive}}, which copies archived sections. Lastly, replace the contents of talk_page with {{subst:#lstx:talk_page|archive}} to remove those sections.

Esiste un supporto opzionale per la trasclusione di sezioni di testo contrassegnate con i titoli normali, ad esempio ==this section==. Se installato, questo viene fatto con la funzione lsth.

Transcludi prima dell'introduzione

To transclude the introduction of a page (i.e. the content before the first heading), use

{{#lsth:pagename}}

Transcludere una sezione specifica

You can also transclude the whole content of the sectionX (which includes all its sub-sections but excludes the heading of sectionX itself).

{{#lsth:pagename|sectionX}}

Cose da notare:

  1. Solo la prima occorrenza della $sezione è transclusa se si ha più di una sezione con lo stesso nome.
  2. Assicurati di digitare il titolo della $sezione in testo wiki e non come viene visualizzato. Ad esempio, se l'intestazione della sezione è ==List of [[Extension]]==, si deve digitare "List of [[Extension]]" e non "List of Extension".
  3. Quando si trasclude una sezione da una pagina contrassegnata per la traduzione utilizzando l'estensione di traduzione, si deve transcludere dalla versione specifica della lingua. Per esempio da pagename/en piuttosto che da pagename.
  4. La corrispondenza NON fa distinzione tra maiuscole e minuscole, per evitare che i collegamenti si interrompano a causa di cambiamenti di maiuscole e minuscole.

Transcludere sezioni multiple

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.

{{#lsth:pagename|sectionX|sectionY}}

Note sulle intestazioni saltate

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.

Quando questa estensione viene utilizzata (con MediaWiki 1.9 o successiva), le funzioni #lst e #lsth contano le intestazioni nella parte iniziale "saltata" e compensano le intestazioni transcluse in modo appropriato. Ciò consentirà a questi collegamenti di indicare la sezione corretta nel caso semplice.

Nota che #lstx non conta le intestazioni saltate e che le intestazioni saltate all'interno di sezioni non contigue non vengono compensate. Ma sembra che ora il problema sia stato risolto (probabilmente con il porting sul nuovo preprocessore di MediaWiki). Le intestazioni transcluse possono essere collegate alle sezioni corrette.

Localizzazione

Internamente, le funzioni parser utilizzano tutte il prefisso lst, per coerenza con il nome dell'estensione. Poiché questo acronimo può creare confusione ai non sviluppatori, sono state introdotte varianti inglesi leggibili, quindi le funzioni possono attualmente essere chiamate con entrambi i nomi.

funzione inglese tedesco ebraico (RTL) portoghese
#lst #section #Abschnitt
#קטע
#trecho
#lstx #section-x #Abschnitt-x
#בלי קטע
#trecho-x
#lsth #section-h

Additionally, the tag can now be localised; currently:

inglese, tedesco, ebraico, portoghese; i.e.:

inglese
<section begin=x/> ... <section end=x/>
tedesco
<Abschnitt Anfang=x/> ... <Abschnitt Ende=x/>
ebraico (RTL)
<קטע התחלה=א> ... <קטע סוף=א> ("start" code to the right and "end" code to the left)
portoghese
<trecho começo=x/> ... <trecho fim=x/>

Each localization is enabled only if the page matches the respective content language.

Limitazioni

  • {{#lsth:pagename|sectionX}} funziona solo sulla prima sezione, se più sezioni hanno il nome sectionX. Solo la prima occorrenza di sezioneX viene trasclusa se un articolo ha più di una sezione con lo stesso nome.
  • Sebbene sia possibile utilizzare questa estensione tra spazi dei nomi, i riferimenti interwiki non vengono risolti. It is not yet possible, for example, to include part of a Wikisource page into a remote MediaWiki installation.
  • I tag di sezione non possono essere transclusi per poter lavorare su altre pagine. {{#lst:}} and {{#lstx:}} funziona solo se i tag di sezione appaiono direttamente nel wikitesto della pagina transclusa. Ciò significa, ad esempio, che questi tag non possono essere incorporati in un modello utilizzando parametri del modello e funzioni parser. La parola magica #tag non funziona con i tag di sezione.
  • A partire dal 2014, i tag di sezione non hanno alcun effetto se utilizzati all'interno di un parametro di modello. Se la pagina A contiene un testo {{B|X}}, non c'è modo che {{#lst:A|...}} possa accedere a X.

Esempi

Vedi anche