Difference between revisions of "Template:Documentation/doc"

From DDwiki
Jump to: navigation, search
(See also)
Line 19: Line 19:
 
=== Best practice ===
 
=== Best practice ===
  
The code should be added at the bottom of the template code, with no space before {{tag|noinclude|o}} (which would cause extra space on pages where the template is used).
+
The code should be added at the bottom of the template code, with no space before <code style="white-space:nowrap;"><nowiki><noinclude></nowiki></code> (which would cause extra space on pages where the template is used).
  
Categories and interwiki links that apply to the template itself should be added to the bottom of the /doc subpage, inside {{tag|includeonly}} tags.
+
Categories and interwiki links that apply to the template itself should be added to the bottom of the /doc subpage, inside <code style="white-space:nowrap;"><nowiki><includeonly>...</includeonly></nowiki></code> tags.
  
If the documentation page contains {{tag|includeonly|o}} or {{tag|noinclude|o}} tags as part of the visible documentation text, replace the "<code>&lt;</code>" with "<code>&amp;lt;</code>".
+
If the documentation page contains <code style="white-space:nowrap;"><nowiki><includeonly></nowiki></code> or <code style="white-space:nowrap;"><nowiki><noinclude></nowiki></code> tags as part of the visible documentation text, replace the "<code>&lt;</code>" with "<code>&amp;lt;</code>".
  
=== See also ===
+
=== Documentation pages ===
  
* {{tl|documentation subpage}} – Used at the top of /doc subpages to explain what they are and to link back to the page they document.
+
Documentation pages should end with the category links for both the documentation page and the template itself, in the following way:
 +
<pre>
 +
<includeonly>[[Category:CATEGORY TO WHICH THE TEMPLATE BELONGS]]</includeonly>
 +
<noinclude>[[Category:Template documentation]]</noinclude>
 +
</pre>
 
<includeonly>[[Category:Template documentation]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>
 
<includeonly>[[Category:Template documentation]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>

Revision as of 01:53, 16 April 2012

This is the {{documentation}} template.

This template displays a green doc box like you are seeing now, and automatically loads the content from a /doc subpage.

Usage

This template is used without any parameters, placed at the bottom of the template or page being documented, within <noinclude>:

<!--Last line of your template code--><noinclude>

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

Then this template automatically loads the content from the /doc subpage of the template it is used on.

Best practice

The code should be added at the bottom of the template code, with no space before <noinclude> (which would cause extra space on pages where the template is used).

Categories and interwiki links that apply to the template itself should be added to the bottom of the /doc subpage, inside <includeonly>...</includeonly> tags.

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

Documentation pages

Documentation pages should end with the category links for both the documentation page and the template itself, in the following way:

<includeonly>[[Category:CATEGORY TO WHICH THE TEMPLATE BELONGS]]</includeonly>
<noinclude>[[Category:Template documentation]]</noinclude>