Template:Documentation/doc
This template uses Lua: |
- Description
- This template is used to insert descriptions on template pages.
- Syntax
- Type
<noinclude>{{documentation}}</noinclude>
at the end of the template page.
General usage
On the Template page
Template code<includeonly>Any categories to be inserted into articles by the template</includeonly><noinclude> {{documentation}}</noinclude>
Note that, depending on the template, you may need to add a clear or complete a table/div just before
is inserted (within the noinclude tags).
{{documentation}}
The line break is also useful as it helps prevent the documentation template "running into" previous code.
On the Template/doc page
- For documentation i18n, see Project:Coding conventions#Documentation i18n.
- For translation guidance, see Project:I18n#Translation.
; {{#invoke:I18n|getMsg|Documentation|description}} : This template is used to do something. ; {{#invoke:I18n|getMsg|Documentation|syntax}} : Type <code>{{t|for|something|page name}}</code> somewhere. ; {{#invoke:I18n|getMsg|Documentation|sample_output}} : {{#invoke:I18n|getMsg<!-- -->|Documentation<!-- -->|sample_output-text<!-- -->|{{t|for|"foo"|"Template:Documentation"}}<!-- -->}} : {{for|foo|Template:Documentation}} <includeonly> Any categories for the template itself </includeonly><noinclude> [[Category:Template documentation|{{PAGENAME}}]] </noinclude>
gives...
- Description
- This template is used to do something.
- Syntax
- Type
somewhere.{{for|<something>|<page name>}}
- Sample output
{{for|foo|Template:Documentation}}
gives...- For foo, see Template:Documentation.
Any categories for the template itself
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.
Dependencies
- Module:Documentation
- Template:Documentation/editintro
- Template:Documentation/preload
- Module:Languages
- MediaWiki:Custom-languages-notice (optional; defaults to Module:Common/i18n)
- MediaWiki:Lang and MediaWiki:Lang/xx
- MediaWiki:Module:Documentation.css
Translation
- The template translations are stored at:
TemplateData
This template is used to insert descriptions on template pages.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Custom Documentation Page | 1 | Page containing the documentation
| Page name | optional |
Force localised subpage | i18n | Forces the use of `/doc/<lang>` pages even for English documentation (unless `/doc` exists and `/doc/en` does not)
| Boolean | optional |
Ignore the current language | ignoreCurrentLang | Ignores the current language, so that wikis in a single language use `/doc` pages only
| Boolean | optional |
Heading | heading | Custom heading
| Line | optional |
Preload Page | preload | The page to preload if the `/doc` subpage doesn't exist.
| Page name | optional |
Content | content | Custom documentation content, prevents transclusion of `/doc` subpage. | Content | optional |