Diferenças entre edições de "Predefinição:Documentation/doc"

Da Thinkfn
< Predefinição:Documentation
Linha 38: Linha 38:
 
== Functions ==
 
== Functions ==
 
If the documentation page doesn't exist, the "edit" link includes a [[mw:Manual:Creating pages with preloaded text|preload]] parameter so that clicking it will pre-fill the edit form with the basic documentation page format.
 
If the documentation page doesn't exist, the "edit" link includes a [[mw:Manual:Creating pages with preloaded text|preload]] parameter so that clicking it will pre-fill the edit form with the basic documentation page format.
 
[[Categoria:!Predefinições para predefinições|{{PAGENAME}}]]
 

Revisão das 14h11min de 4 de dezembro de 2008

Predefinição
código | documentação | categoria | parâmetros | desenvolvimento | testes


Esta é a página da documentação. O texto abaixo será sempre apresentado na página do código, para que quem consulte o código da predefinição veja também a documentação.

Nota: Se está a criar esta página pela primeira vez, ela já foi pré-preenchida com o modelo que deve seguir. Siga-o, por favor. Não categorize esta página. Coloque a categoria da predefinição na página da categoria.
Esta predefinição transcreve e inclui (transclui) uma página de documentação para dentro da página de código de outra predefinição. Esse processo está a ocorrer neste momento: o texto que está a ler, não está na página Predefinição:Documentation, que é a página do código de {{documentation}}, mas sim na página Predefinição:Documentation/doc.

O uso de {{documentation}} dentro de uma predefinição, tal como aqui foi feito, permite que o código da predefinição seja protegido enquanto que a respectiva documentação, que está noutra página, pode continuar a ser editada pelos utilizadores.

Uso

Para usar {{documentation}} adicione o seguinte código após o código da predefinição:

<noinclude>{{documentation}}<noinclude>

Não deve ser deixado qualquer espaço ou quebra de linha antes do <noinclude> inicial, porque isso pode causar espaçamentos extra onde a predefinição for usada.

Por omissão, a página que é incluida tem o mesmo nome e o sufixo /doc. No entanto, é possível usar o parâmetro para incluir outra página:

<noinclude>{{documentation|<nome da outra página>}}<noinclude>

Best practice

This code should be added at the bottom of the template code, with no extra space before "<noinclude>" (which would cause extra space on pages where the template is used). The parameter can be used as shown above to transclude an arbitrary documentation page.

Categories and interwiki links that apply to the template itself should be added to the documentation page, inside <includeonly> </includeonly> tags. For more complex cases, see Wikipedia:Template documentation‎#Categories and interwiki links.

If the documentation page contains includeonly or noinclude tags as part of the documentation, replace the "<" with "&lt;".


In-line content

<noinclude>{{Documentation|content=This is documentation.}}</noinclude>

In-line content with [view][edit] links

<noinclude>{{Documentation
|1 = Template:any page/doc
|content ={{Template:any page/doc|parameters}}
}}</noinclude>

Customizing display

Overrides exist to customize the output in special cases:

  • {{documentation| heading = ...}} − change the text of the "documentation" heading. If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.

Functions

If the documentation page doesn't exist, the "edit" link includes a preload parameter so that clicking it will pre-fill the edit form with the basic documentation page format.