Difference between revisions of "Template:Doc"
1416006136 (talk | contribs) m (change Category:Simplified Chinese to Category:Chinese) |
SirYodaJedi (talk | contribs) m |
||
Line 42: | Line 42: | ||
--><div style="overflow-y:auto;max-height:200px;padding:2px 6px; "><span class=plainlinks><!-- | --><div style="overflow-y:auto;max-height:200px;padding:2px 6px; "><span class=plainlinks><!-- | ||
--><div>[[File:Icon-visibility.png|16px|link=]] [[Special:PrefixIndex/{{FULLPAGENAME}}/|{{autolang|1=Subpages|eo=Paĝidoj|es=Subpáginas|ru=Под­страницы|de=Unterseiten|zh=子页面}}]]</div><!-- | --><div>[[File:Icon-visibility.png|16px|link=]] [[Special:PrefixIndex/{{FULLPAGENAME}}/|{{autolang|1=Subpages|eo=Paĝidoj|es=Subpáginas|ru=Под­страницы|de=Unterseiten|zh=子页面}}]]</div><!-- | ||
− | --><div>[[File:Icon-deblur.png|16px|link=]] [{{fullurl:{{FULLPAGENAME}}|action=purge}} {{autolang|1=Purge|eo=Refreŝigi|es=Purga|ru=Очистить кэш|vi=Làm mới|zh=清除缓存|ka=წმენდს|de=Aktualisieren}}]</div><!-- | + | --><div>[[File:Icon-deblur.png|16px|link=]] [{{fullurl:{{FULLPAGENAME}}|action=purge}} {{autolang|1=Purge cache|eo=Refreŝigi|es=Purga|ru=Очистить кэш|vi=Làm mới|zh=清除缓存|ka=წმენდს|de=Aktualisieren}}]</div><!-- |
--><div>[[File:Strings icon.png|16px|link=]] [{{fullurl:{{FULLPAGENAME}}/strings|{{#ifexist:{{FULLPAGENAME}}/strings||action=edit&preload={{urlencode:Template:Strings subpage/preload}}}}}} {{autolang|1=Strings|zh=字符串}}]</div><!-- | --><div>[[File:Strings icon.png|16px|link=]] [{{fullurl:{{FULLPAGENAME}}/strings|{{#ifexist:{{FULLPAGENAME}}/strings||action=edit&preload={{urlencode:Template:Strings subpage/preload}}}}}} {{autolang|1=Strings|zh=字符串}}]</div><!-- | ||
--><div>{{#switch:{{{tools|}}}|#default=[[File:Icon-sandbox.png|16px|link=]] {{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/sandbox}}| [[{{FULLPAGENAME}}/sandbox|{{autolang|1=Sandbox|eo=Designejeto|es=Terreno de pruebas|ru=Песоч­ница|zh=沙盒}}]] | [{{fullurl:{{FULLPAGENAME}}/sandbox|action=edit&preload={{urlencode:{{FULLPAGENAME}} }} }} {{autolang|1=Sandbox|eo=Designejeto|es=Terreno de pruebas|ru=Песоч­ница|zh=沙盒}}]}}</div><!-- | --><div>{{#switch:{{{tools|}}}|#default=[[File:Icon-sandbox.png|16px|link=]] {{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/sandbox}}| [[{{FULLPAGENAME}}/sandbox|{{autolang|1=Sandbox|eo=Designejeto|es=Terreno de pruebas|ru=Песоч­ница|zh=沙盒}}]] | [{{fullurl:{{FULLPAGENAME}}/sandbox|action=edit&preload={{urlencode:{{FULLPAGENAME}} }} }} {{autolang|1=Sandbox|eo=Designejeto|es=Terreno de pruebas|ru=Песоч­ница|zh=沙盒}}]}}</div><!-- |
Latest revision as of 17:16, 14 May 2024
Please follow the format on this subpage(s) to add translations.
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.
Template:Doc/preload
or Template:Doc/preload/<lang code>
(if the UI language isn't in English and the translations of the preload page exist), as the content of the new page and open the editing page. If there is a English documentation, the button will preload the English documentation as the content.View
– opens the documentation page.Edit
– opens the editing of the documentation page.History
– opens the history of changes to the documentation page.
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=<lang code>
into the page link, so if you click on another language, then along with the documentation, the interface language will change.
If there is no documentation in a certain language, the message “The <page> documentation page does not exist” will be displayed. if {{{pagespace}}} or actual page space is User
, then the message “The <user> did not provide information about himself on this language (<page>).” will be displayed instead. Also, after this message, documentation in English will be displayed, if it exists.
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”.
- 3 – will display the message “This is the <page> info subpage”. Useful for user subpages.
- 4 – will display the message “This is a documentation subpage for use on multiple pages”. If the {{{list}}} parameter is used, then the text will be: “This is a documentation subpage for use on multiple pages listed in <list page>”.
- {{{list}}}: specifies a page or category that lists pages using a particular documentation page. Used only if parameter {{{1}}} is set to 4.
- {{{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”
- User → “About”
- In all other cases it will be “Documentation”
- {{{tools}}}: controls which tool buttons should be displayed:
- 0 – no buttons.
- 1 – only buttons “Create”, “View”, “Edit” and “History”.
- In all other cases there will be all buttons
Creating documentation
|
.To start creating documentation, click on the “Create” button on the top right. The button loads the preloaded document (or as a preloaded document if there is an English document). 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. If you want to add categories, just add them where the preload documentation indicated.
Subpages
There are some subpages and sub-templates on {{Doc}}. They are created to make the things easier.
{{Doc/subpage}}
This template is the replacement of <noinclude>{{doc|0}}</noinclude>
. It can be instead of <noinclude>{{doc|0}}</noinclude>
.
Its purpose is the same as {{Documentation subpage}}.
It can avoid the problem that preload page won't load <noinclude>{{doc|0}}</noinclude>
.
{{Doc/Sandbox other}}
This template adds content separately to the main template and its subpages (documents). It is useful for adding categories.
Its purpose is the same as {{Sandbox other}}.
Template:Doc/preload
This is the preload page when you click the create button. You can add translations for it.
{{Doc/PreviewBlock}}
Deprecated. Use {{Capsule}} instead.
(22 August 2022)
20240514171614
14.581 kilobytes
0.014581 megabytes
The above documentation is transcluded from Template:Doc/doc. (edit | history)
Editors can experiment in this template's sandbox (edit) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this page.