Template:Testcase/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.

Use this template to illustrate the proper (and maybe improper) usage of a template and its parameters.

Parameters

Parameter name Required? Default value Description
title Yes (n/a) Brief description of testcase (e.g., "No parameter" or "Parameter: foo"
Anonymous parameter 1 Yes (n/a) Example wikicode inside a <nowiki> element.
Anonymous parameter 2 Yes (n/a) Same wikicode without <nowiki>.
Anonymous parameter 3 Yes (n/a) Same wikicode without <nowiki>, using "/sandbox" after the template name.

While omitting the third anonymous parameter does not give an error, it would not allow editors to see how the sandbox version of the template compares to the main version. Please use all three parameters, even if there is currently no sandbox version of the template being documented.

Note
Avoid including links (or using templates that provide links) in the title paramater. The colors used by this template make such links very hard to see.

Usage

See the template's testcases:

Note: Here we show how this template would be used to document the template {{Package}}.

The wikicode:

{{Testcase
|title=One unnamed parameter
|<nowiki>{{Package|sys-apps/portage}}</nowiki>
|        {{Package|sys-apps/portage}}
|{{Package/sandbox|sys-apps/portage}}
}}

Results in:

One unnamed parameter
Wiki code {{Package|sys-apps/portage}}

Main version sys-apps/portage
Sandbox version sys-apps/portage


Using the sandbox version:

{{Testcase/sandbox
|title=One unnamed parameter
|<nowiki>{{Package|sys-apps/portage}}</nowiki>
|        {{Package|sys-apps/portage}}
|{{Package/sandbox|sys-apps/portage}}
}}

Results in:

See also