Template:Doc/doc

From Valve Developer Community
< Template:Doc
Revision as of 10:30, 2 September 2022 by Max34 (talk | contribs) (Created page with "<noinclude>Category:English{{doc|0}}</noinclude>__NOTOC__ The template <code style=padding:0>{{tl|doc}}</code> is designed to add a block of documentation to various pages...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Edit-copy.png
This is a documentation subpage for Template:Doc.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

The template {{doc}} is designed to add a block of documentation to various pages (mainly template pages). The subpages of a certain language will be loaded into the documentation block depending on the language of the user interface. In the case of English, the documentation will be taken from the /doc subpage. But in all other cases, the documentation will be taken from the subpage /doc/<lang code>

Tools

The main tools are located on the top right, above the documentation block:

  • «Create» – opens the creation of the documentation page. Appears only if the documentation page does not exist.
  • «View» – opens the documentation page.
  • «Edit» – opens the editing of the documentation page.
  • «History» – opens the history of changes to the documentation page.
Note.pngNote:If there are none of the above tools, then the text of the documentation was written using the {{{content}}} parameter.

Also, in the upper right corner there is a button marked with an ellipsis [ ]. It expands/collapses additional tools:

  • «Sandbox» – opens the creation of a subpage /sandbox and copies the code of the original page, or, if this page exists, simply opens it.
  • «Testcases» – opens the /testcases subpage. Useful for testing a template in different situations.
  • «Subpages» – opens Special:PrefixIndex and inserts the page name to search for all subpages.
  • «Purge» – opens a window with a message about purging the page.

Language bar

On the top right, under the tools, there are flags that switch documentation to another language. Switching is implemented by inserting &uselang=<language code> into the page link, so if you click on another language, then along with the documentation, the interface language will change.

The language bar can be removed if you set {{{nolang}}} to 1.

If there is no documentation in a certain language, the message “The <page> documentation page does not exist” will be displayed, and the language flag will be highlighted in red.

Parameters

  • {{{1}}}: parameter for switching the template assignment:
    • If you need a standard documentation block, do not enter anything in this parameter.
    • 0 – will display the message “This is a documentation subpage for <page>”.
    • 1 – will display the message “This is the sandbox subpage for <page>”.
    • 2 – will display the message “This page is not a sandbox”.
  • {{{docpage}}}: the page that will be used as documentation.
  • {{{content</lang code>}}}: content that will be used as documentation, instead of a separate page. When used, the main tools are hidden.
  • {{{pagespace}}}: the page space is determined automatically, but you can enter your own. The text in the header depends on this parameter:
    • Template → “Template Documentation”
    • File → “Summary”
    • In all other cases it will be “Documentation”
  • {{{nolang}}}: removes the language bar if set to 1.
  • {{{examples}}}: examples that can be copied and used on other pages go here. When used, the “Examples” button appears, on the left under the title of the documentation block.

Creating documentation

To start creating documentation, click on the “Create” button on the top right. At the very beginning of the documentation, add the template {{doc}} and enter 0 in the parameter {{{1}}}. After that, you will see a message stating that this is a documentation subpage. And so that this message does not appear in the documentation block, it should be written in this way:

<noinclude>{{doc|0}}</noinclude>

Then the text of the documentation itself is written. First there is a brief description, and then – depending on what the documentation is written for.

Warning.pngWarning:If you want to add the symbol “|” somewhere in the text (templates and other MediaWiki elements are not affected), use &#124;.