×
Create a new article
Write your page title here:
We currently have 22 articles on The Grand Library of Hylia. Type your article name above or click on one of the titles below and start writing!



The Grand Library of Hylia
Revision as of 15:53, 9 December 2023 by ZoeySaurusRawr (talk | contribs) (Created page with "<onlyinclude><b>{{((}}{{PAGENAME}}{{#if: {{{sub|}}}|/{{{sub}}}|}}</b>{{#if: {{{1|}}} | <b>{{!}}</b><i> {{{1}}} </i> |}}{{#if: {{{2|}}} | <b>{{!}}</b><i> {{{2}}} </i> |}}{{#if: {{{3|}}} | <b>{{!}}</b><i> {{{3}}} </i> |}}{{#if: {{{4|}}} | <b>{{!}}</b><i> {{{4}}} </i> |}}{{#if: {{{5|}}} | <b>{{!}}</b><i> {{{5}}} </i> |}}{{#if: {{{6|}}} | <b>{{!}}</b><i> {{{6}}} </i> |}}{{#if: {{{7|}}} | <b>{{!}}</b><i> {{{7}}} </i> |}}{{#if: {{{8|}}} | <b>{{!}}</b><i>...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

{{Usage}}

Purpose

In an effort to maintain consistent, complete, concise, and coherent documentation for Template:!((Templates]], each template page includes a Usage section, using this template to demonstrate how to properly utilize that template according to its Purpose.

Usage

In its simplest form, this template can be displayed in-line or on its own line.

{{Usage| parameter1 | parameter2 | ... | parameter9 }}

Thus, {{Usage|quality|name|description}}

becomes {{Usage| quality | name | description }}

To specify a subpage of the template, pass an argument to the named parameter "sub".

{{Usage| sub= | param1 | param2 | ... }}

Parameters

It's often useful to define the parameters for a template. Using {{Usage/Param}}, one can describe each parameter and even specify if it's optional and, if so, its default value.

{{Usage/Param| parameter | description | optional | default }}

  • parameter — A name for the parameter. If it isn't a named parameter, this is arbitrary.
  • description — A description of the named parameter.
  • optional — If this argument is included, the parameter will be marked "Optional." (Optional.)
  • default — Use this parameter only if "optional" is also specified. This will display what value is used if the parameter isn't given an argument. (Optional.)

Blocks

For templates with a large number of parameters, or whose arguments are expected to be lengthy, it's best to break them up into several lines. This is especially used for templates that use named parameters so that the undefined ones can be omitted. This also makes it easier to copy, paste, and fill out values. In order to format it consistently, pass the parameters into {{Usage/Block}}. After the parameter descriptions, {{Clear}} must always be added to prevent subsequent text from being pushed to the right.

{{Usage/Block| param1 | param2 | ... | param20 }}

  • param1...param20 — Each named parameter, up to 20.
ExampleResult
{{Usage/Block|name|rank|serial}}
{{Usage/Param|name|description}}
{{Usage/Param|rank|description}}
{{Usage/Param|serial|description}}
{{Clear}}
{{Usage
| name = 
| rank = 
| serial = 
}}


  • name — description
  • rank — description
  • serial — description

As with the basic use of {{Usage}}, an optional "sub" parameter can be set to specify a subpage. Also, one anonymous parameter can be added by passing a value to "anon", like so:

ExampleResult
{{Usage/Block|sub=Deceased|anon=cause
|date|medals|family}}
{{Usage/Param|cause|description}}
{{Usage/Param|date|description}}
{{Usage/Param|medals|description}}
{{Usage/Param|family|description}}
{{Clear}}
{{Usage/Deceased|cause
| date = 
| medals = 
| family = 
}}


  • cause — description
  • date — description
  • medals — description
  • family — description

Composites

Some templates make use of subtemplates to effect more modularity. To demonstrate the use of several templates working together, simply place them in a preformatted box floated to the left, with a description either to the right of or below the box.

ExampleResult
{{Float|left|<pre>
{{Several}}
{{Templates}}
</pre>}}
Description
{{Clear|left}}
{{Several}}
{{Templates}}

Description

Examples

The best way to demonstrate a template may depend on the template itself. For simple one-liners, this is often enough:

<code><nowiki>{{Template}}</nowiki></code> → {{Template}}

Other times it may be necessary to lay out the code and the result in a table. To simplify this, use {{Usage/Example}} and {{Usage/Result}}. Start with {{Usage/Example}}, then wrap the code in <pre> tags. Finally, copy the code - without the <pre> tags - as an argument to {{Usage/Result}}.

{{Usage/Example}}
<pre>{{TemplateCode}}</pre>
{{Usage/Result|
{{TemplateCode}}
}}

Note that {{Usage/Example}} is used by itself with the example code following it, while {{Usage/Result}} takes the result code as an argument.