Vai al contenuto

Template:Documentazione

À prupositu di Wikipedia
Documentazione di template[vista] [edità] [cronulugia] [purga]


Eccu u mudellu di{{Documentation}}imprudatu in guasi ogni pagina di mudellu per cuntene e struzzione è infurmazione documentate di quellu mudellu, ancu<templatedata>.

Per struzzione precise nantu à cumu è quandu aduprà stu mudellu, vedeWikipedia:Template documentation(shortcut:WP:TDOC).

Stu mudellu visualizza una casella di documentazione verdi cum'è vi vede avà è carica automaticamente u cuntenutu da una subpagina / doc. Pudete ancu carà u cuntenutu da altri posti, se hè struitu per.

Stu mudellu hè destinatu à documentà mudelli è altre pagine chì sòtransclusin altre pagine. Pò esse usatu in umudellu namespaceè a maiò parte di altrespazii di nomi.

L'usu di stu mudellu permette chì i mudelli sianuprutettuinduv'ellu hè necessariu, mentre ch'ellu permette à qualchissia di edità a ducumentazione è e categurie.

U so usu

[edità a fonte]

Nurmalmente stu mudellu hè adupratu senza paràmetri, postu in u fondu di u mudellu o di a pagina ducumentata, in un<noinclude>...</noinclude>containeru:

<!--Last line of your template code--><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>

Allora questu mudellu carica automaticamente u cuntenutu da a pagina sottu / doc di u mudellu chì hè utilizatu.

Stu mudellu pò ancu carricà u cuntenutu da qualsiasi altra pagina. Cum'è què:


<!--Last line of your template code--><noinclude>
{{Documentation|Template:Otherpage/doc}}
</noinclude>

Nota chì quandu caricate a documentazione da una pagina altru da a pagina locale / doc diventa difficile per trattà di e categurie.

U cuntenutu pò ancu esse alimentatu direttamente cum'è testu. Cum'è què:

<!--Last line of your template code--><noinclude>
{{Documentation
|content=
(somedocumentation)
}}</noinclude>

Quandu si usa u parametru|content=,a casella doc ùn mostra normalmente i ligami [edit] [purge] in u cantonu superiore dirittu. Innota chì se a pagina / doc esiste, un ligame per ellu hè sempre mostratu in a scatula di ligame sottu a casella doc.

U parametru|1=è u parametru|content=ponu ancu esse cumminati, cum'è questu:

<!--Last line of your template code--><noinclude>
{{Documentation|1=Template:Anypage/doc
|content=
{{Template:Anypage/doc|parameters}}
}}</noinclude>

Allora u pagename alimentatu cum'è paràmetru 1 hè usatu per i ligami [edit] [purge] è per u ligame / doc in a casella di ligame sottu a casella doc. Ma u paràmetrucuntenutuhè usatu per u cuntenutu mostratu in a casella doc. U codice sopra significa chì u cuntenutu hè trascrittu cum'è{{Template:Any page/doc|parameters}}.In questu esempiu un paràmetru hè alimentatu ancu à a pagina / doc.

Locu è tag

[edità a fonte]
Stu codice deve esse aghjuntu à u fondu di u codice di mudellu, senza poche di spazii prima<noinclude>(chì causaria più spaziu nant'à e pagine induve u mudellu hè adupratu):
<noinclude>
{{documentation}}
</noinclude>

Per inserisce automaticamente inoinclude tags,a chjama di mudellu è u cumentu di guida, pudete ancu aduprà sta shortcut di codicesubstitution:

{{subst:doc-code}}

Which results in:
<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->
</noinclude>

Certa prassi

[edità a fonte]

I categurie chì applicanu à u mudellu stessu deve esse aghjuntu à u fondu di a subpage / doc, à l'internu<noinclude>{{Sandbox other||...}}</noinclude>.I ligami Interwiki chì applicanu à u mudellu sò deve esse elencu inWikidata(più àWikipedia:Wikidata). Per casi più cumplessi, vedeWikipedia:Template documentation#Categories è ligami interwiki.

Se a pagina di documentazione cuntene<includeonly>o<noinclude>etichette cum'è parte di u testu di a documentazione visibile, rimpiazzate u "<"cun"&lt;"o usàTemplate:tag.

Intestazione

[edità a fonte]

Quandu in u nome di spazi Template, stu mudellu mostra sta rubrica:

Template documentation

In a maiò parte di altri spazii di nomi, cum'è "Wikipedia:", mostra sta rubrica:

Documentation

Ma quandu nantu à e pagine File (image) mostra sta rubrica:

Sintesi

U paràmetruintestazionepò esse usatu per stabilisce l'intestazione à qualcosa altru. Cum'è què:

{{Documentation |heading=Infobox documentation}}

Se u paràmetru'intestazione'hè viotu ma definitu, ùn hè micca mostratu alcun rubricu è ùn ci sò affissati alcuni [edit] [purge]. Cum'è què:

{{Documentation |heading=}}

Theheading-styleparameter can be fed optionalCSSvalues. Without quotation marks""but with the ending semicolons;.For example:

heading-style=font-size:150%;color:red;
[edità a fonte]

Below the big doc box is a small link box that shows some meta-data about the documentation. The link box shows different things depending on what parameters are fed to this template, and in which namespace it is used. In some cases the link box is not shown at all.

To hide the link box, add the parameter

|link box=off.

You can also insert customised text into the link box, by setting the|link box=parameter. For example:

|link box=This documentation is automatically generated by [[Template:Country showdata]]

Automatic functions

[edità a fonte]

If the documentation page does not exist, the [create] link includes apreloadpage so that clicking it will pre-fill the edit form with the basic documentation page format. Preload text is also used for the /sandbox and /testcases [create] links.

When this template is on a protected template page it now automatically adds {{pp-template}}, which shows the grey or red padlock in the top right corner. So no need to manually add{{pp-template}}to templates that use {{Documentation}}.

When this template is on a /sandbox subpage it automatically adds the {{Template sandbox notice}}.

Subject namespaces vs. talk namespaces

[edità a fonte]

Terminology:Subject namespacesare the opposite oftalk namespaces.For instance "Template:" is the subject space of "Template talk:".

This template is usually placed in a subject namespace, within<noinclude>tags. But in some cases this template needs to be on the talk page:

  • In the Mediawiki namespace, sinceoften does not work in system messages, and since the Mediawiki namespace needs to be kept clean for performance reasons.

When placed on talk pages, this template usually is placed near the top of the page and without<noinclude>...</noinclude>tags.

The /doc, /sandbox and /testcases pages should normally be in the subject namespace, except in the namespaces that do not have the MediaWikisubpage featureenabled: Main, File, Mediawiki and Category. (But currently we only show the /sandbox and /testcases links from User, User talk, Template and Template talk namespaces.) There are also a whole bunch of other technical reasons why the /doc page must be stored under the talk page for those (but only those) namespaces.

This template automatically points its [create] links for the /doc, /sandbox and /testcases to the right namespace.

You can simulate the output for a given page by using the|page=parameter. For example, if you use the code|page=Template:Edit protected,the template will behave exactly as if it were on the pageTemplate:Edit protected,including showing the documentation fromTemplate:Edit protected/doc,linking toTemplate:Edit protected/sandbox,etc. This parameter is useful for testing and is used extensively on themodule testcases page.

Technical details

[edità a fonte]

The preload page for the /doc [create] link isTemplate:Documentation/preload.The preload pages for the /sandbox and /testcases [create] links areTemplate:Documentation/preload-sandboxandTemplate:Documentation/preload-testcases.The preload page for the /sandbox [mirror] link isTemplate:Documentation/mirror.

For more details, see thetalk page.

Full syntax

[edità a fonte]
{{Documentation}}

{{Documentation
| content =
}}

{{Documentation
| [path to documentation page]
| heading-style =
| heading =
| link box =
}}

See also

[edità a fonte]