Diferenças entre edições de "Predefinição:Documentation/doc"
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. | ||
− | |||
− |
Revisão das 14h11min de 4 de dezembro de 2008
|
{{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 "<".
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.