Template:Documentation/doc: Difference between revisions

From Honkai: Nexus Anima Wiki
Jump to navigation Jump to search
FANDOM (talk | contribs)
No edit summary
 
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
==Description==
{{Documentation/Header}}
This template is used to insert descriptions on template pages.
{{Lua|Documentation}}
{{CSS}}
This template is used to insert documentation to template pages.


==Syntax==
==Syntax==
Add <code><nowiki><noinclude></nowiki>{{t|Documentation}}<nowiki></noinclude></nowiki></code> at the end of the template page.
* {{T|Documentation}} will produce the documentation template.
* {{T|Documentation|foo}} will fill in the documentation from the "<code>foo</code>" template.
* {{T|Documentation|p1=content=This template does something}} will fill in the documentation with the content "<code>This template does something</code>." (not recommended except for very, very short documentation)
* {{T|Documentation|p1=heading=Important information}} will replace the default heading with "<code>Important information</code>".
* {{T|Documentation|p1=type=category}} will add the "<code>category Templates</code>" category.


Add <code><nowiki><noinclude></nowiki>{{t|Documentation|documentation page}}<nowiki></noinclude></nowiki></code> to transclude an alternative page from the /doc subpage.
==Template Data==
 
<templatedata>
==Usage==
{
 
"description": {
===On the Template page===
"en": "This template is used to insert descriptions on template pages."
This is the normal format when used:
},
 
"format": "inline",
<pre>
"params": {
TEMPLATE CODE
"1": {
<includeonly>Any categories to be inserted into articles by the template</includeonly>
"label": {
<noinclude>{{Documentation}}</noinclude>
"en": "Custom Documentation Page"
</pre>
},
 
"description": {
''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).''
"en": "Page containing the documentation"
 
},
''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.''
"default": "{{FULLPAGENAME}}/doc",
 
"type": "wiki-page-name"
===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]]).
"heading": {
 
"label": {
Normally, you will want to write something like the following on the documentation page:
"en": "Heading"
 
},
<pre>
"description": {
==Description==
"en": "Custom heading"
This template is used to do something.
},
 
"default": {
==Syntax==
"en": "[[File:Template-icon.svg|50px|link=|alt=Documentation icon]] Documentation"
Type <code>{{t|templatename}}</code> somewhere.
},
 
"type": "line"
==Samples==
},
<code>&lt;nowiki>{{templatename|input}}&lt;/nowiki></code>
"preload": {
 
"label": {
results in...
"en": "Preload Page"
 
},
{{templatename|input}}
"description": {
 
"en": "The page to preload if the `/doc` subpage doesn't exist."
<includeonly>Any categories for the template itself</includeonly>
},
<noinclude>[[Category:Template documentation]]</noinclude>
"default": "Template:Documentation/preload",
</pre>
"type": "wiki-page-name"
 
},
Use any or all of the above description/syntax/sample output sections. You may also want to add "see also" or other sections.
"content": {
 
"label": {
Note that the above example also uses the [[Template:T]] template.
"en": "Content",
 
"tr": "İçerik"
<includeonly>[[Category:Documentation templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>
},
"description": {
"en": "Custom documentation content, prevents transclusion of `/doc` subpage."
},
"type": "content"
},
"type": {
"label": "Type",
"description": "Category to categorize template in.",
"type": "string",
"suggested": true
}
}
}
</templatedata>

Latest revision as of 20:28, 29 August 2025

This is the documentation page for Documentation.
It contains usage information, categories, and other content not part of the original template page.
This template uses Module:Documentation, a script written in Lua.
This template uses CSS found at MediaWiki:Documentation.css (edit | hist).

This template is used to insert documentation to template pages.

Syntax

[edit source]
  • {{Documentation}} will produce the documentation template.
  • {{Documentation|foo}} will fill in the documentation from the "foo" template.
  • {{Documentation|content = This template does something}} will fill in the documentation with the content "This template does something." (not recommended except for very, very short documentation)
  • {{Documentation|heading = Important information}} will replace the default heading with "Important information".
  • {{Documentation|type = category}} will add the "category Templates" category.

Template Data

[edit source]

This template is used to insert descriptions on template pages.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Custom Documentation Page1

Page containing the documentation

Default
{{FULLPAGENAME}}/doc
Page nameoptional
Headingheading

Custom heading

Default
[[File:Template-icon.svg|50px|link=|alt=Documentation icon]] Documentation
Lineoptional
Preload Pagepreload

The page to preload if the `/doc` subpage doesn't exist.

Default
Template:Documentation/preload
Page nameoptional
Contentcontent

Custom documentation content, prevents transclusion of `/doc` subpage.

Contentoptional
Typetype

Category to categorize template in.

Stringsuggested