Template:Documentazione/man

À prupositu di Wikipedia


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, vede Wikipedia: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ò transclus in altre pagine. Pò esse usatu in u mudellu namespace è a maiò parte di altre spazii di nomi.

L'usu di stu mudellu permette chì i mudelli sianu prutettu induv'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:Other page/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 =
(some documentation)
}}</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:Any page/doc
| content =
{{Template:Any page/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àmetru cuntenutu hè 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 i noinclude tags, a chjama di mudellu è u cumentu di guida, pudete ancu aduprà sta shortcut di codice substitution :

{{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 in Wikidata (più à Wikipedia:Wikidata). Per casi più cumplessi, vede Wikipedia: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àmetru intestazione pò 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=}}

The heading-style parameter can be fed optional CSS values. Without quotation marks " " but with the ending semicolons ;. For example:

heading-style=font-size:150%;color:red;

Link box[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 a preload page 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 namespaces are the opposite of talk 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, since often 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 MediaWiki subpage feature enabled: 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.

Testing[edità a fonte]

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 page Template:Edit protected, including showing the documentation from Template:Edit protected/doc, linking to Template:Edit protected/sandbox, etc. This parameter is useful for testing and is used extensively on the module testcases page.

Technical details[edità a fonte]

The preload page for the /doc [create] link is Template:Documentation/preload. The preload pages for the /sandbox and /testcases [create] links are Template:Documentation/preload-sandbox and Template:Documentation/preload-testcases. The preload page for the /sandbox [mirror] link is Template:Documentation/mirror.

For more details, see the talk page.

Full syntax[edità a fonte]

{{Documentation}}

{{Documentation
 | content =
}}

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

See also[edità a fonte]