Template:Documentation: Difference between revisions

m (1 revision)
 
(Replaced content with "{{#invoke:Documentation | page}}")
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
<!--
{{#invoke:Documentation | page}}
  Automatically add {{template sandbox notice}} when on a /sandbox page.
-->{{#ifeq: {{SUBPAGENAME}} | sandbox
| <div style="clear: both;"></div>{{template sandbox notice|{{{livepage|}}}}}
}}<!--
  Automatically add {{pp-template}} to protected templates.
-->{{template other
| {{#ifeq: {{PROTECTIONLEVEL:move}} | sysop
  | {{pp-template|docusage=yes}}
  | {{#if: {{PROTECTIONLEVEL:edit}}
    | {{pp-template|docusage=yes}}
    | <!--Not protected, or only semi-move-protected-->
    }}
  }}
}}<!--
  Start of green doc box.
-->{{documentation/start box2
| preload = {{{preload|}}}  <!--Allow custom preloads-->
| heading = {{{heading|¬}}}  <!--Empty but defined means no header-->
| heading-style = {{{heading-style|}}}
| content = {{{content|}}}
 
<!--Some namespaces must have the /doc, /sandbox and /testcases
    in talk space-->
| docspace = {{documentation/docspace}}
 
| 1 = {{{1|}}}  <!--Other docname, if fed-->
 
<!--The namespace is added in /start box2-->
| template page = {{documentation/template page}}
 
}}<!-- Start content --><!--
  Start load the /doc content:
  Note: The line breaks between this comment and the next line are necessary
  so  "=== Headings ===" at the start and end of docs are interpreted.
-->
{{#switch: {{#if:{{{content|}}}|1|0}}{{#if:{{{1|}}}|1|0}}{{#ifexist:{{{1|}}}|1|0}}{{#ifexist:{{documentation/docspace}}:{{documentation/template page}}/doc|1|0}}
| 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110
| 1111 = {{{content|}}}
| 0110 | 0111 = {{ {{{1}}} }}
| 0001 | 0011 = {{ {{documentation/docspace}}:{{documentation/template page}}/doc }}
| 0000 | 0100 | 0010 | 0101 =
}}
<!--
  End load the /doc content:
  Note: The line breaks between this comment and the previous line are necessary
  so  "=== Headings ===" at the start and end of docs are interpreted.
-->{{documentation/end box2
| preload = {{{preload|}}}  <!--Allow custom preloads-->
| content = {{{content|}}}
| link box = {{{link box|}}}  <!--So "link box=off" works-->
 
<!--Some namespaces must have the /doc, /sandbox and /testcases
    in talk space-->
| docspace = {{documentation/docspace}}
 
| 1 = {{{1|}}}  <!--Other docname, if fed-->
 
<!--The namespace is added in /end box2-->
| template page = {{documentation/template page}}
 
}}<!--
  End of green doc box
--><noinclude>
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>

Latest revision as of 07:53, 22 July 2015

[view | edit | history | purge]Documentation
This template uses Module:Documentation, a script written in Lua.
Please see wp:Lua and mw:Extension:Scribunto to learn more.

For templates, insert <noinclude>{{subst:doc}}</noinclude> at the end of the template, then save the page, this will place {{documentation}} and a comment advising editors where to place categories and interwiki links. For other types of pages, the documentation template should already be there.

Click "create" at the top of the page and the documentation page will be opened with some pre-formatting. This formatting can also be created by using {{subst:doc}} on the documentation page.

Documentation pages will automatically be added to Category:Documentation pages. Using {{doc}} without subst: will add the page to Category:Pages with templates requiring substitution.

Optional parameters

This parameters can either be added to the {{subst:doc}} template when creating the page, or added to the {{documentation}} template afterwards.

type

Sets the "type" of documentation this is, e.g. template, module, message, etc. This will be used as part of some messages the template might display, as well as categorisation.

The type is automatic based on the namespace, so it shouldn't generally need to be set.

page

The page where the documentation should be. This defaults to a subpage of the current page called "doc".

content

Allows documentation content to be specified directly, rather than on a separate sub-page. Useful for small page-specific sub-page templates, e.g. Explosion/table.

nodoc

If a template has no documentation and you don't know how to use it, add nodoc=1 to the documentation template on the documentation page. The documentation's background will become red to make it more noticeable, and the page will be added to Category:Templates with no documentation, if it's a template.

This is automatically set if the documentation page doesn't exist or is empty, so this generally isn't necessary to set.

baddoc

Similar to nodoc, this is used to mark templates that do have documentation, but it isn't very good. This can mean it doesn't have enough examples, doesn't explain all the functions properly, or doesn't explain the point of the template properly. The documentation's background will become yellow to make it more noticeable, and the page will be added to Category:Templates with bad documentation, if it's a template.

[view | edit | history | purge]The above documentation is transcluded from Template:Documentation/doc.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Need wiki hosting?

Do you need a wiki for your Minecraft mod/gaming wiki? We'll host it for free! Contact us.

Other wikis

Indie-game wikis
Powered by Indie Wikis