Template:Documentation/doc

From Gentoo Wiki
Jump to:navigation Jump to:search
Note
This page is a template. It contains some standardized, often used text, which can be transcluded inside other pages. As this template is widely used in our wiki, it may be protected in which case only staff members can change it. Use the discussion page to propose enhancements or fixes, or to voice your opinion.

This template provides a mechanism to document other pages (usually another template, but technically it can be used in other namespaces — the following information assumes it is being used on a template page).

The actual documentation is contained in a subpage whose title is the title of the current page plus the suffix /doc. (For example, if {{Documentation}} is called on the page Template:C, the documentation will be transcluded from the page Template:C/doc.)

For details on how to properly document templates, see Help:Templates#Adding documentation and categories and Help:Template sandbox and test cases.

Parameters

None in typical usage (see next section). However, this template actually passes the following parameters (with empty default values) to {{Documentation/core2}}, so certain default settings can be overridden.

Parameter name Required? Default value Description
heading No (n/a) Section heading shown at top of documentation.
heading-style No (n/a) Currently unused.
content No (n/a) If provided, will be shown instead of the /doc subpage.
link box No (n/a) If provided, will be shown instead of the standard "The above documentation is transcluded…" message. Special value off suppresses the message completely.

Do not override any of these unless you have a really good reason.

Usage

<noinclude>
{{Documentation}}
</noinclude>

The <noinclude> element is necessary to ensure that the template documentation (say, Template:C/doc) appears when viewing the template it's documenting (Template:C) but not any other page where the template is called (e.g., Gentoo Wiki:Guidelines, which contains {{C}} template calls).

(As the standard usage of this template is so simple, no test cases are shown here.)

See also