Template:TemplateDocTop
From KayakWiki
This is the TemplateDocTop Template.
For more information on templates - see About Templates
Note that four parts are required to document a parameterized template.
- TemplateDocTop - this template
- TemplateDocTableHead - Parameter Table headers
- Parameter table content
- TemplateDocBottom - finish the documentation section.
For templates without parameters (see Template:Stub for an example), only the following two parts are required.
- TemplateDocTop - this template
- TemplateDocBottom - finish the documentation section.
The purpose of these templates is to ensure that all templates have the same general look and are minimally documented. All templates should use these templates for their creation. If you are at the point where you're creating a template, you probably know a lot about the wiki and markup techniques. It may be easiest for you to look at another template and see how these documentation templates are used. It would certainly be useful to do so to augment your understanding of these documentation templates and templates in general. Try Template:Book, for example.
For a template with parameters:
Copy the template text between the lines below (no need to edit, just mark and copy) and paste it into the edit page. Then fill in the parameters. If a parameter does not apply, you can delete the parameter and its associated pipe (|).
Copy below this line:
<noinclude>
{{TemplateDocTop
|TemplateDesc=
|BasicTemplate=
}}
{{TemplateDocTableHead
|TableWidth=
|Col1Width=
|Col2Width=
|Col3Width=
}}
|-
|Parameter name
|Parameter description
|Mandatory/Default
|}
{{TemplateDocBottom}}
</noinclude>
Template code goes here...
Copy above this line.
For a template without parameters, copy the following lines.
Copy below this line:
<noinclude>
{{TemplateDocTop
|TemplateDesc=
|BasicTemplate=
}}
{{TemplateDocBottom}}
</noinclude>
Template code goes here...
Copy above this line.
[edit] Parameter definitions
| Parameter | Description | Mandatory or Default value |
| TemplateDesc | This is text that describes the purpose and intent of the template. | Mandatory |
| BasicTemplate | This is the rudimentary text - the minimum needed to use the template. It should be imbedded in <nowiki> tags so that it is not interpreted by the wiki. It should be adequate for the user of the template to simply copy the text and fill in values for any possible parameters to use the template successfully. The example is between the copy lines above for this template. | Mandatory |
| TableWidth | The width of the table that shows the parameter definitions. It can be in any valid HTML form, e.g. - 80% | Default: 100% |
| Col1Width | The width of the parameter name column. It can be in any valid HTML form, e.g. - 30% | Default: 20% |
| Col2Width | The width of the parameter description column. It can be in any valid HTML form, e.g. - 30% | Default: 40% |
| Col3Width | The width of the mandatory/default column. It can be in any valid HTML form, e.g. - 30% | Default: 20% |
| Parameter Definitions | This is a list of parameters in Wiki table format - you cannot use HTML table format here. If there are no parameters, delete the Template:TemplateDocTableHead section and these table sections.. Otherwise, the parameter list should be in the form of table rows with three columns per row. Each row starts with the parameter name, then the description of the parameter and then the text indicating whether it is mandatory or what default value is used. The format is
Replace these three fields with the values for a parameter and duplicate all four lines for each parameter in the template. There should be one of the above rows for each parameter.
|
Default: none - remove this section if no parameters are required. |
| Template Code | This is the raw text of the template. This part of the document is the template itself. It is a good idea to develop the template without bothering with documentation first. When it works as you wish, then add the Template:TemplateDocTop and other documentation above the working template code. | Mandatory |
The template follows (you won't see the whole thing if null defaults exist in the template):
This is the TemplateDocTop Template.
For more information on templates - see About Templates
{{{TemplateDesc}}}
Copy the template text between the lines below (no need to edit, just mark and copy) and paste it into the edit page. Then fill in the parameters. If a parameter does not apply, you can delete the parameter and its associated pipe (|).
Copy below this line:
{{{BasicTemplate}}}
Copy above this line.

