Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
DOORS Site Logo

Welcome to the Official DOORS Wiki!
Please read the Wiki Rules the Manual of Style and familiarise yourself with our Wiki Policies before contributing to get a better understanding of what content is allowed on our wiki and how to display it properly, if you need help don't hesitate to reach out to a DOORS Wiki Staff Member.

Template:Documentation/doc: Difference between revisions

Template page
(Updated formatting.)
(Updated the Documentation template documentation from the Templates Wiki.)
Line 1: Line 1:
{{#ifexist: Template:T | <!-- nothing; T already copied/exists --> | :<strong class="error">Please copy <nowiki>{{T}}</nowiki> from [[w:c:templates:Template:T]] to [[Template:T]]!</strong>}}<!--
==Description==
-->{{#ifexist: Template:T/doc | <!-- nothing; T's documentation already copied/exists --> | :<strong class="error">Please copy <nowiki>{{T}}</nowiki>'s documentation from [[w:c:templates:Template:T/doc]] to [[Template:T/doc]]!</strong>}}<!--
This template is used to insert descriptions on template pages.
-->{{#ifexist: Template:Tocright | <!-- nothing; Tocright already copied/exists --> | :<strong class="error">Please copy <nowiki>{{Tocright}}</nowiki> from [[w:c:templates:Template:Tocright]] to [[Template:Tocright]]!</strong>}}<!--
-->{{#ifexist: Template:Tocright/doc | <!-- nothing; Tocright's documentation already copied/exists --> | :<strong class="error">Please copy <nowiki>{{Tocright}}</nowiki>'s documentation from [[w:c:templates:Template:Tocright/doc]] to [[Template:Tocright/doc]]!</strong>}}<!--


<!-- you can remove this line and everything above it if you don't see any big bold red text -->
==Syntax==
Add <code><nowiki><noinclude></nowiki>{{t|Documentation}}<nowiki></noinclude></nowiki></code> at the end of the template page.
<noinclude>{{Documentation subpage}}</noinclude>
; Description

: This template is used to insert documentation on template pages.
Add <code><nowiki><noinclude></nowiki>{{t|Documentation|documentation page}}<nowiki></noinclude></nowiki></code> to transclude an alternative page from the /doc subpage.
; Syntax

: Type <code>&lt;noinclude>{{T|Documentation}}&lt;/noinclude></code> at the end of the template page.
==Usage==

===On the Template page===
This is the normal format when used:


== General usage ==
=== On the Template page ===
<pre>
<pre>
Template code<noinclude>
TEMPLATE CODE
{{Documentation}}
<includeonly>Any categories to be inserted into articles by the template</includeonly>
<noinclude>{{Documentation}}</noinclude>
</noinclude>
</pre>
</pre>


=== On the Template/doc page ===
''If your template is not a completed div or table, you may need to close the tags just before <code><nowiki>{{Documentation}}</nowiki></code> is inserted (within the noinclude tags).''

''A line break right before <code><nowiki>{{Documentation}}</nowiki></code> can also be useful as it helps prevent the documentation template "running into" previous code.''

===On the documentation page===
The documentation page is usually located on the /doc subpage for a template, but a different page can be specified with the first parameter of the template (see [[#Syntax|Syntax]]).

Normally, you will want to write something like the following on the documentation page:

<pre>
<pre>
== Description ==
; Description
This template is used to do something.
: This template is used to do something.
; Dependencies:
:* Uses (some CSS, JS, file, or other template).
; Syntax
: Type <code>{{T|Templatename}}</code> somewhere.
; Sample output
: <code>&lt;nowiki>{{Templatename|foo}}</nowiki></code> gives...
: {{Templatename|foo}}


<includeonly>Any categories for the template itself
== Syntax ==
</includeonly><noinclude>
Type <code>{{T|Templatename}}</code> somewhere.
[[Category:Template documentation]]
</noinclude>
</pre>


Use any or all of the above description/syntax/sample output sections. You may also want to add "see also" or further usage information sections.
== Samples ==
<code>&lt;nowiki>{{Templatename|input}}&lt;/nowiki></code>

results in...

{{Templatename|input}}

<includeonly>Any categories for the template itself</includeonly>
<noinclude>[[Category:Template documentation]]</noinclude>
</pre>


Note that the above example also uses {{T|T}}.
Use any or all of the above description/syntax/sample output sections. You may also want to add "see also" or other sections.


== Dependencies ==
Note that the above example also uses the [[Template:T]] template.
; Templates
: [[Template:Documentation/preload]]
: [[Template:Documentation/preload-sandbox]]
: [[Template:Documentation/preload-testcases]]
: [[Template:Tocright]] ([[Template:Tocright/doc]])


== TemplateData ==
<includeonly>[[Category:Documentation templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>
<templatedata>
{
"params": {
"1": {
"description": "The name of the custom /doc subpage.",
"example": "Template:Documentation/doc",
"default": "{{FULLPAGENAME}}/doc",
"label": "Custom Documentation Location",
"type": "string"
},
"content": {
"description": "Content if documentation page will not be transcluded",
"example": "This template creates quotes.",
"label": "Inline Documentation Content",
"type": "string"
},
"sandbox": {
"label": "Custom Sandbox Location",
"description": "Specifies the /sandbox subpage location",
"example": "Template:Example/sandbox",
"type": "string",
"default": "{{FULLPAGENAME}}/sandbox"
},
"testcases": {
"label": "Custom Testcases Location",
"description": "Specifies the /testcases subpage location",
"example": "Template:Example/testcases",
"type": "string",
"default": "{{FULLPAGENAME}}/testcases"
},
"heading": {
"label": "Heading text",
"description": "Changes the default \"Documentation\" header to a different one",
"example": "About this template",
"type": "string"
},
"footer": {
"label": "Custom footer content",
"description": "Replaces the default link box with a custom one",
"example": "Documentation is automatically generated by {{T|Ambox}}.<br/>Its contents are shown here.",
"type": "unbalanced-wikitext"
}
},
"description": "This template is used to display documentation on template pages. It also adds some tools to help the editor to modify the /doc subpage and the template."
}
</templatedata><includeonly>[[Category:Documentation templates| ]]</includeonly>

Revision as of 20:25, 23 August 2022

Edit-copy green.svg
This is a template documentation subpage for Template:Documentation.
It contains usage information, categories, interlanguage links and other content that is not part of the original template page.
Description
This template is used to insert documentation on template pages.
Syntax
Type <noinclude>{{Documentation}}</noinclude> at the end of the template page.

General usage

On the Template page

Template code<noinclude>
{{Documentation}}
</noinclude>

On the Template/doc page

; Description
: This template is used to do something.
; Dependencies:
:* Uses (some CSS, JS, file, or other template).
; Syntax
: Type <code>{{T|Templatename}}</code> somewhere.
; Sample output
: <code><nowiki>{{Templatename|foo}}</nowiki></code> gives...
: {{Templatename|foo}}

<includeonly>Any categories for the template itself
</includeonly><noinclude>
[[Category:Template documentation]]
</noinclude>

Use any or all of the above description/syntax/sample output sections. You may also want to add "see also" or further usage information sections.

Note that the above example also uses {{T}}.

Dependencies

Templates
Template:Documentation/preload
Template:Documentation/preload-sandbox
Template:Documentation/preload-testcases
Template:Tocright (Template:Tocright/doc)

TemplateData

This template is used to display documentation on template pages. It also adds some tools to help the editor to modify the /doc subpage and the template.

Template parameters

ParameterDescriptionTypeStatus
Custom Documentation Location1

The name of the custom /doc subpage.

Default
{{FULLPAGENAME}}/doc
Example
Template:Documentation/doc
Stringoptional
Inline Documentation Contentcontent

Content if documentation page will not be transcluded

Example
This template creates quotes.
Stringoptional
Custom Sandbox Locationsandbox

Specifies the /sandbox subpage location

Default
{{FULLPAGENAME}}/sandbox
Example
Template:Example/sandbox
Stringoptional
Custom Testcases Locationtestcases

Specifies the /testcases subpage location

Default
{{FULLPAGENAME}}/testcases
Example
Template:Example/testcases
Stringoptional
Heading textheading

Changes the default "Documentation" header to a different one

Example
About this template
Stringoptional
Custom footer contentfooter

Replaces the default link box with a custom one

Example
Documentation is automatically generated by {{T|Ambox}}.<br/>Its contents are shown here.
Unbalanced wikitextoptional