Help:Template Documentation: Difference between revisions

From BoyWiki
New page: ===Documentation and categories=== Categorizing your template and documenting its proper usage will make it easier for other editors to find and use. For detailed advice, see [[Wikipedia:T...
 
No edit summary
Line 1: Line 1:
===Documentation and categories===
===Documentation and categories===
Categorizing your template and documenting its proper usage will make it easier for other editors to find and use. For detailed advice, see [[Wikipedia:Template documentation]].
Categorizing your template and documenting its proper usage will make it easier for other editors to find and use.  


Documentation for users, together with the template's categories and [[WP:interwiki links|interwiki links]], is normally placed after the template code, inside "noinclude" tags. It is normally necessary to put the opening "noinclude" tag immediately after the end of the code, with no intervening spaces or newlines, to avoid transcluding unwanted whitespace.
Documentation for users, together with the template's categories and [[WP:interwiki links|interwiki links]], is normally placed after the template code, inside "noinclude" tags. It is normally necessary to put the opening "noinclude" tag immediately after the end of the code, with no intervening spaces or newlines, to avoid transcluding unwanted whitespace.
Line 6: Line 6:
In the case of complex templates, the documentation (together with categories and wikilinks) is often kept on a separate [[WP:subpage|subpage]] of the template page (named "Template:XXX/doc"). This also applies to many [[WP:protection|protected]] templates (to allow the information to be edited by non-administrators). This is achieved by placing the {{tl|Documentation}} template after the main template code (within "noinclude" tags). If the "/doc" subpage does not exist, a link will then appear enabling it to be created.
In the case of complex templates, the documentation (together with categories and wikilinks) is often kept on a separate [[WP:subpage|subpage]] of the template page (named "Template:XXX/doc"). This also applies to many [[WP:protection|protected]] templates (to allow the information to be edited by non-administrators). This is achieved by placing the {{tl|Documentation}} template after the main template code (within "noinclude" tags). If the "/doc" subpage does not exist, a link will then appear enabling it to be created.


Some templates contain category definitions in their transcluded code, i.e. they are intended to place the target pages in particular categories. This is often done with maintenance categories (placing articles into ordinary content categories in this way is discouraged). When doing this, it may be necessary to use "includeonly" tags to keep the template itself out of the category. The template should also be designed to suppress categorization in the case of demonstration uses — see [[WP:CATSUP|Category suppression in templates]].
Some templates contain category definitions in their transcluded code, i.e. they are intended to place the target pages in particular categories. This is often done with maintenance categories (placing articles into ordinary content categories in this way is discouraged). When doing this, it may be necessary to use "includeonly" tags to keep the template itself out of the category. The template should also be designed to suppress categorization in the case of demonstration uses 

Revision as of 15:06, 24 December 2012

Documentation and categories

Categorizing your template and documenting its proper usage will make it easier for other editors to find and use.

Documentation for users, together with the template's categories and interwiki links, is normally placed after the template code, inside "noinclude" tags. It is normally necessary to put the opening "noinclude" tag immediately after the end of the code, with no intervening spaces or newlines, to avoid transcluding unwanted whitespace.

In the case of complex templates, the documentation (together with categories and wikilinks) is often kept on a separate subpage of the template page (named "Template:XXX/doc"). This also applies to many protected templates (to allow the information to be edited by non-administrators). This is achieved by placing the {{Documentation}} template after the main template code (within "noinclude" tags). If the "/doc" subpage does not exist, a link will then appear enabling it to be created.

Some templates contain category definitions in their transcluded code, i.e. they are intended to place the target pages in particular categories. This is often done with maintenance categories (placing articles into ordinary content categories in this way is discouraged). When doing this, it may be necessary to use "includeonly" tags to keep the template itself out of the category. The template should also be designed to suppress categorization in the case of demonstration uses