Template:Doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Changing High-use param)
No edit summary
 
(31 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{High-use|approx=1800}}
{{High-use|approx=1,800}}
{{todo|Exclude Sandbox subpage and other from this template. Also do some code cleanup.}}
{{todo|Exclude Sandbox subpage and other from this template. Also do some code cleanup.}}
{{todo|Make this code less shitty.}}
{{doc}}
{{doc}}
<includeonly>
<includeonly>


<onlyinclude>{{Doc/templateusecategory}}{{#if:{{{content|}}}|[[Category:Documentation using content parameter]]}}{{ulf|all-lang=1}}{{#switch:{{{1|}}}
<onlyinclude>{{Doc/templateusecategory}}{{#if:{{{content|}}}|[[Category:Documentation using content parameter]]}}{{ulf|all-lang=1}}{{#switch:{{{1|}}}
| #default =  
| #default = <div style="clear:both; margin-top:1em; border:1px solid #4F4F4F; background-color:#323232; border-radius:.3em; scrollbar-color: #686868 #424242 !important;"><!--
<div style="clear:both; margin-top:1em; border:1px solid #505050; background-color:#323232; border-radius:2px">
--><div style="width:100%"><!--
<div style="width:100%"><div style="display:flex; gap:8px; background:#505050; padding:6px 6px 6px 10px; flex-direction:{{#switch:{{Intlang}}|he=row-reverse| align=right|#default=row}}"><div style="display:flex; flex-direction:{{#switch:{{Intlang}}|he=row-reverse|#default=row}}; align-items:center; font-size:1.2em; color:#D8D8D8;">{{#switch:{{{pagespace|{{SUBJECTSPACE}}}}}
--><div style="display:flex; gap:8px; background:#4F4F4F; padding:.5em .55em .55em .8em; flex-direction:{{#switch:{{intlang}}|he=row-reverse| align=right|#default=row}}"><!--
| #default = {{Doc/strings|documentation}}
--><div style="display:flex; flex-direction:{{#switch:{{intlang}}|he=row-reverse|#default=row}}; align-items:center; font-size:1.2em; color:#D8D8D8;"><!--
| Template = <span style="{{#switch:{{Intlang}}|he=padding-left|#default=padding-right}}:6px;pointer-events:none;user-select:none;">[[File:Curly_brackets_white.png|32px|link=]]</span>{{#if:{{AVAILABLEDOCPAGENAME|{{{docpage|}}}}}
-->{{#switch:{{{pagespace|{{SUBJECTSPACE}}}}}
| [[{{AVAILABLEDOCPAGENAME|{{{docpage|}}}}}|{{Doc/strings|TemplateDoc}}]]
| #default = {{Doc/strings|documentation}}
| [[{{DOCPAGENAME|{{{docpage|}}}}}|{{Doc/strings|TemplateDoc}}]]
| Template = <span style="{{#switch:{{intlang}}|he=padding-left|#default=padding-right}}:6px;pointer-events:none;user-select:none;">[[File:Curly_brackets_white.png|32px|link=]]</span><!--
}}&nbsp;{{#if: {{AVAILABLEDOCPAGENAME|translated=1|{{{docpage|}}}}}
-->{{#if:{{AVAILABLEDOCPAGENAME|{{{docpage|}}}}}
| [{{PageCreateLink|create={{DOCPAGENAME|{{{docpage|}}}}}|alt={{lc:{{int:Edit}}}}}}]
| '''{{Doc/strings|TemplateDoc}}'''&nbsp;&#91;[[{{AVAILABLEDOCPAGENAME|{{{docpage|}}}}}|{{lc:{{int:View}}}}]]&#93;
| {{#if: {{AVAILABLEDOCPAGENAME|{{{docpage|}}}}}  
| '''{{Doc/strings|TemplateDoc}}'''&nbsp;&#91;[[{{DOCPAGENAME|{{{docpage|}}}}}|{{lc:{{int:View}}}}]]&#93;
| [{{PageCreateLink|create={{BASEDOCPAGENAME|{{{docpage|}}}}}|alt={{lc:{{int:Edit}}}}}}] [ [[{{DOCPAGENAME|{{{docpage|}}}}}|{{lc:{{int:create}}}}]]&nbsp;{{Flag|{{intlang}}}}]
}}&nbsp;<!--
| [ [[{{DOCPAGENAME|{{{docpage|}}}}}|{{lc:{{int:create}}}}]] ]
-->{{#if: {{AVAILABLEDOCPAGENAME|translated=1|{{{docpage|}}}}}
}}
| [{{PageCreateLink|create={{DOCPAGENAME|{{{docpage|}}}}}|alt={{lc:{{int:Edit}}}}}}]
}}
| {{#if: {{AVAILABLEDOCPAGENAME|{{{docpage|}}}}}  
| File = {{Doc/strings|Summary}}
| [{{PageCreateLink|create={{BASEDOCPAGENAME|{{{docpage|}}}}}|alt={{lc:{{int:Edit}}}}}}]<!--
| User = {{Doc/strings|About}}
--> [{{PageCreateLink|create={{DOCPAGENAME|{{{docpage|}}}}}|preload=Doc/preload{{intlang|pref=/}}|alt={{lc:{{int:create}}}}}}&nbsp;{{Flag|{{intlang}}}}]
}}</div><div style="display:flex; gap:6px; margin-left:auto"><!--
| [{{PageCreateLink|create={{DOCPAGENAME|{{{docpage|}}}}}|preload=Doc/preload{{intlang|pref=/|default-none=1}}|alt={{lc:{{int:create}}}}}}]
}}
}}
| File = {{Doc/strings|Summary}}
| User = {{Doc/strings|About}}
}}</div><!--
--><div style="display:flex; gap:6px; margin-left:auto"><!--


     + Language button
     ------------------------------ Language button ------------------------------


--><div class="mw-customtoggle-language" style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px">[[File:Icon-translate.png|link=|14px]]&nbsp;Available doc translations </div><!--
--><div class="mw-customtoggle-language" style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:.3em; user-select:none; padding:0 4px">[[File:Icon-translate.png|link=|14px]]&nbsp;Available doc translations </div><!--


-->{{#switch:{{{tools|}}}|#default=
-->{{#switch:{{{tools|}}}
{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{Intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }} }}
| #default = {{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }} }}
|<!--  
|<!--  


view button  
------------------------------ view button ------------------------------
 
-->{{#if:{{{content{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }}| }}}
|
|<!--
 
------------------------------ history button ------------------------------
 
--><div style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:.3em; user-select:none; padding:0 4px"><!--
--><div style="position: relative; top:-1.5px; "><!--
-->[[File:Icon-history.png|14px|link={{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }}|action=history}}|{{int:history}}]]<!--
--></div><!--
--></div><!--
-->}}<!-- ##### if:PROTECTIONEXPIRY #####
-->}}<!-- ##### if:CONTENT #####
 
------------------------------ more options button (...) ------------------------------


-->{{#if:{{{content{{Intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }}| }}}||<div style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px"><div style="position: relative; top: -1.5px; ">[[File:Icon-visibility.png|14px|link={{{docpage|{{FULLPAGENAME}}/doc}}}{{Intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }}|{{int:view}}]]</div></div><!--  
-->{{#switch:{{{tools|}}}
| #default = <div class="mw-customtoggle-doctools" style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:.3em; user-select:none; padding:0 4px">'''…'''</div>
|1=
}}<!-- ##### switch:TOOLS (2) ##### -->
|0=
}}<!-- ##### switch:TOOLS (1) #####
--></div><!--
--></div><!--
--></div><!--  


history button
------------------------------ dropdown area ------------------------------


--><div style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px"><div style="position: relative; top: -1.5px; ">[[File:Icon-history.png|14px|link={{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{Intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }}|action=history}}|{{int:history}}]]</div></div>}}
--><div style="padding:0.4em 1em; overflow:hidden"><!--
}}
--><div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-doctools" style="display:none; overflow:hidden; background:#404040; border:1px solid rgba(255, 255, 255, 0.1); border-radius:4px; box-shadow:0 10px 20px rgb(0,0,0,.3); user-select:text; position:absolute; z-index:1001; right:8px; "><!--
{{#switch:{{{tools|}}}|#default=
--><div style="overflow-y:auto;max-height:200px;padding:2px 6px; "><span class="plainlinks"><!--
<div class="mw-customtoggle-doctools" style="display:inline-flex; justify-content:center; align-items:center; height:100%; box-sizing:border-box; background:#323232; border:1px solid rgba(255,255,255,.3); border-radius:2px; user-select:none; padding:0 4px">'''…'''</div>
|1=}}</span>|0=}}
</div></div></div><div style="padding:0.4em 1em;">
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-doctools" style="display:none; overflow:hidden; background:#404040; border:1px solid rgba(255, 255, 255, 0.1); border-radius:4px; box-shadow:0 10px 20px rgb(0,0,0,.3); user-select:text; position:absolute; z-index:1001; right:8px; "><!--
--><div style="overflow-y:auto;max-height:200px;padding:2px 6px; "><span class=plainlinks><!--
--><div>[[File:Icon-visibility.png|16px|link=]] [[Special:PrefixIndex/{{FULLPAGENAME}}/|{{Doc/strings|Subpages}}]]</div><!--
--><div>[[File:Icon-visibility.png|16px|link=]] [[Special:PrefixIndex/{{FULLPAGENAME}}/|{{Doc/strings|Subpages}}]]</div><!--
--><div>[[File:Strings icon.png|16px|link=]] [{{fullurl:{{FULLPAGENAME}}/strings|{{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/strings}}||action=edit&preload={{urlencode:Template:Strings subpage/preload}}}}}} {{Doc/strings|Strings}}]</div><!--
--><div>[[File:Strings icon.png|16px|link=]] [{{fullurl:{{FULLPAGENAME}}/strings|{{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/strings}}||action=edit&preload={{urlencode:Template:Strings subpage/preload}}}}}} <span style="color:#648cc8;">{{Doc/strings|Strings}}</span>]</div><!--
--><div>{{#switch:{{{tools|}}}|#default=[[File:Icon-sandbox.png|16px|link=]] {{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/sandbox}}| [[{{FULLPAGENAME}}/sandbox|{{Doc/strings|SandboxButton}}]] | [{{fullurl:{{FULLPAGENAME}}/sandbox|action=edit&preload={{urlencode:{{FULLPAGENAME}} }} }} {{Doc/strings|SandboxButton}}]}}</div><!--
--><div>{{#switch:{{{tools|}}}|#default=[[File:Icon-sandbox.png|16px|link=]] {{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/sandbox}}| [[{{FULLPAGENAME}}/sandbox|{{Doc/strings|SandboxButton}}]] | [{{fullurl:{{FULLPAGENAME}}/sandbox|action=edit&preload={{urlencode:{{FULLPAGENAME}} }} }} {{Doc/strings|SandboxButton}}]}}</div><!--
--><div>{{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/testcases}}| [[{{FULLPAGENAME}}/testcases|{{Doc/strings|Testcase}}]] |[[File:Icon-task alt.png|16px|link=]] [{{fullurl:{{FULLPAGENAME}}/testcases|action=edit}} {{Doc/strings|Testcase}}]}}|1=}}</div><!--
--><div>{{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/testcases}}| [[{{FULLPAGENAME}}/testcases|{{Doc/strings|Testcase}}]] |[[File:Icon-task alt.png|16px|link=]] [{{fullurl:{{FULLPAGENAME}}/testcases|action=edit}} {{Doc/strings|Testcase}}]}}|1=}}</div><!--
--></span></div><!--
--></span></div><!--
--></div>
--></div><!--
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-language" style="display:none; overflow:hidden; background:#404040; border:1px solid rgba(255, 255, 255, 0.1); border-radius:4px; box-shadow:0 10px 20px rgb(0,0,0,.3); user-select:text; position:absolute; z-index:1000; right:{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{Intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }} }}|126px|68px}}; "><!--
 
--><div style="overflow-y:auto;max-height:200px;padding:2px 6px; "><span class=plainlinks><!--
------------------------------ Languages area ------------------------------


--><div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-language" style="display:none; overflow:hidden; background:#404040; border:1px solid rgba(255, 255, 255, 0.1); border-radius:4px; box-shadow:0 10px 20px rgb(0,0,0,.3); user-select:text; position:absolute; z-index:1000; right:{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }} }}|126px|68px}}; "><!--
--><div style="overflow-y:auto;max-height:200px;padding:2px 6px; "><span class="plainlinks"><!--
******************** TODO: Probably do a for each thing for flags ********************
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|en|English|content={{{content|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|en|English|content={{{content|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|eo|Esperanto|content={{{content/eo|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|eo|Esperanto|content={{{content/eo|}}}}}</div><!--
Line 83: Line 112:


--></span></div><!--
--></span></div><!--
--></div>
--></div><!--
{{{content{{Intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}|{{{content|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{Intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}}}
-->{{#if: {{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}}}
|{{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/strings}}|{{Strings notice}}{{ {{FULLPAGENAME}}/strings |String info}}}}{{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/testcases}}|{{Testcase notice}}|}}{{:{{{docpage|{{FULLPAGENAME}}/doc}}}{{Intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}}}
|
|{{metanotice|id=[[file:Info.png|45px]]|rgb=0, 127, 242|style=padding:7px;margin-top:14px|text={{Doc/strings|PageNotExist|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}}}}}
| {{metanotice
{{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/strings}}|{{Strings notice}}{{ {{FULLPAGENAME}}/strings|String info}}}}{{:{{{docpage|{{FULLPAGENAME}}/doc}}}}}}}}}}}}}
|id=[[File:Info.png|45px]]
</div></div><!--  
|rgb=0, 127, 242
|style=padding: 7px; background: rgba(0,127,242,0.1); border-radius: 5px; border: 2px solid rgba(0,127,242,0.3);
|text={{Doc/strings|PageNotExist|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}}}
}}
}}<!--
-->{{#if: {{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/strings}}
| {{Strings notice|TempDoc=1}}{{ {{FULLPAGENAME}}/strings|String info }}
}}<!--
-->{{#if: {{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/testcases}}
| {{Testcase notice|TempDoc=1}}
}}<!--


doc/subpage translations
--------------- Doc transclusion ---------------
The "if" should be on a new line, or some tags, like == header == wont appear as a header
-->
{{#if: {{{content{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}|}}}
| {{{content{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}}}}
| {{#if: {{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}}}
| {{:{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}
|DocParam1={{{DocParam1|}}}|DocParam2={{{DocParam2|}}}|DocParam3={{{DocParam3|}}}|DocParam4={{{DocParam4|}}}|DocParam5={{{DocParam5|}}} }}
| {{:{{{docpage|{{FULLPAGENAME}}/doc}}}
|DocParam1={{{DocParam1|}}}|DocParam2={{{DocParam2|}}}|DocParam3={{{DocParam3|}}}|DocParam4={{{DocParam4|}}}|DocParam5={{{DocParam5|}}} }}
}}<!-- ##### if:PROTECTIONEXPIRY ##### -->
}}<!-- ##### if:CONTENT ##### --></div></div><!--


-->| 0 = {{Metanotice
------------------------------ doc/subpage translations | switch function at first line of the template ------------------------------
| id = [[File:Edit-copy.png|40px|link=]]
 
| opacity =.05
-->| 0 = {{doc/subpage/0usecheck}}{{Doc/subpage}}[[Category:Pages using deprecated Doc 0]]
| rgb = 255, 255, 255
| 4 = {{doc/subpage/4usecheck}}{{Doc/multi-subpage}}[[Category:Pages using deprecated Doc 4]]
| text = {{Doc/strings|Docsp}}
&nbsp;</div><div class="plainlinks" style="display:flex; align-items:center; justify-content:center; margin-left:auto"><div>[{{fullurl:{{NAMESPACE}}:{{ROOTPAGENAME}}|action=purge}} <font style="display:inline-flex; background:#36C; border-radius:3px; color:#FFF; font-weight:bold; white-space:nowrap; position:relative; z-index:10; padding:6px 10px">{{Doc/strings|Purge}}</font>]</div></div></div>
<!-- Not being used -->
[[Category:Template documentation pages]]}}
| 1 = {{doc/subpage/1usecheck}}{{messagebox|borderstyle=|image=[[File:Sandbox.png|40px|link=]]
| 1 = {{messagebox|borderstyle=|image=[[File:Sandbox.png|40px|link=]]
|text= {{Doc/strings|Sandboxsp}} ([{{fullurl:Special:ComparePages|page1={{NAMESPACEE}}:{{ROOTPAGENAMEE}}&page2={{FULLPAGENAMEE}}}} {{Doc/strings|diff}}])}}[[Category:Sandbox pages]]
|text= {{Doc/strings|Sandboxsp}} ([{{fullurl:Special:ComparePages|page1={{NAMESPACEE}}:{{ROOTPAGENAMEE}}&page2={{FULLPAGENAMEE}}}} {{Doc/strings|diff}}])}}[[Category:Sandbox pages]]
| 2 = {{messagebox|borderstyle=|image=[[File:Sandbox Not.png|40px|link=]]
| 2 = {{doc/subpage/2usecheck}}{{messagebox|borderstyle=|image=[[File:Sandbox Not.png|40px|link=]]
|text={{Doc/strings|NotSandbox 1}}}}
|text={{Doc/strings|NotSandbox 1}}}}
|small={{Doc/strings|NotSandbox 2}}
|small={{Doc/strings|NotSandbox 2}}
| 3 = {{messagebox|borderstyle=|image=[[File:Edit-copy.png|40px|link=]]
| 3 = {{doc/subpage/3usecheck}}{{messagebox|borderstyle=|image=[[File:Edit-copy.png|40px|link=]]
|text={{Doc/strings|Infosp}}}}
|text={{Doc/strings|Infosp}}}}
| 4 = {{messagebox|borderstyle=|image=[[File:Edit-copy.png|40px|link=]]
 
|text={{Doc/strings|MultiDocsp}}}}[[Category:Template documentation pages]]
}}<!-- ##### SWITCH FUNCTION, first line of the template #####
}}{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{Intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}}}|<div class="plainlinks" style="background:#323232; border:1px solid #505050; border-radius:2px; padding:0.4em 1em; margin-top:1em;">''{{Doc/strings|transcluded|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}}}'' <small>([{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{Intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}|action=edit}} {{int:edit}}] {{!}} [{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{Intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}|action=history}} {{int:History}}])</small><br>''{{Doc/strings|Sandbox}}''</div>|}}</onlyinclude>
 
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}
|1
|0
}}<!-- ##### if:PROTECTIONEXPIRY ##### -->
}}<!-- ##### INTLANG ##### -->
}}<!-- ##### if:PROTECTIONEXPIRY ##### -->
|<div class="plainlinks" style="background:#323232; border:1px solid #505050; border-radius:.3em; padding:0.4em 1em; margin-top:1em;"><!--
-->''{{Doc/strings|transcluded|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}}}''<!--
-->&nbsp;<small>([{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}
|1
|0
}}<!-- ##### if:PROTECTIONEXPIRY ##### -->
}}<!-- ##### INTLANG ##### -->
|action=edit}} {{int:edit}}] {{!}} [{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}
|1
|0
}}<!-- ##### if:PROTECTIONEXPIRY ##### -->
}}<!-- ##### INTLANG ##### -->
|action=history}} {{int:History}}])</small><br>''{{Doc/strings|Sandbox}}''</div>
|}}<!-- ##### if:PROTECTIONEXPIRY ##### --></onlyinclude>


</includeonly>__NOTOC__
</includeonly>__NOTOC__

Latest revision as of 06:50, 14 October 2025

Warning icon.png
This template is used on approximately 1,800 pages and changes may be widely noticed.
Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage.
Consider discussing changes on the talk page before implementing them.
Todo: Exclude Sandbox subpage and other from this template. Also do some code cleanup.
Todo: Make this code less shitty.
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)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
Page history
Icon-translate.png
This template uses a strings subpage
Please follow the format on this subpage(s) to add translations.
Number of strings:17
Approximate status of translation:English (en) 100% Deutsch (de) 41.18% Español (es) 47.06% Esperanto (eo) 47.06% Hrvatski (hr) 94.12% 日本語 (ja) 5.88% 한국어 (ko) 5.88% Ქართული (ka) 11.76% Nederlands (nl) 5.88% Polski (pl) 5.88% Português (pt) 5.88% Português do Brasil (pt-br) 5.88% Русский (ru) 100% Українська (uk) 5.88% Tiếng Việt (vi) 23.53% 中文 (zh) 88.24% 
Gnome app science.png
This template uses a Testcases subpage
You can test how this page looks with its different skins and parsers.

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.
Note.pngNote:If there are none of any documentations, the button will load a preload documentation, 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.
Note.pngNote:If there are none of the above tools, then the text of the documentation was written using the {{{content}}} parameter, or parameter {{{tools}}} was set to 0.

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.
  • {{{DocParam1}}} to {{{DocParam5}}}: Optional parameters passed to the documentation page (the /doc subpage and supported by {{{docpage}}}).
    • If the documentation uses {{{DocParam1}}}, then passing {{{DocParam1}}} in the template transclusion (e.g. {{Doc|DocParam1=Hello World!}}) will affect how the doc is rendered, good for documentation pages only needing a different value.
  • {{{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”
Note.pngNote:if {{{pagespace}}} or actual page space is “User”, then the text will be taken from the /about subpage, not /doc.
  • {{{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

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

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.

Template:Doc
Logo-template.png
Summary
Transcludes a documentation subpage
Type
Wrapper template
Contributors
N/A
Creation date
22/08/2022
(22 August 2022)
Notes
N/A
Subpages
Documentation
Preload
Sandbox
Strings
Testcases
N/A
Revision information
Latest editor
THE OWL
Last edited
14/10/2025
20251014065018
Revision size
14125 bytes
14.125 kilobytes
0.014125 megabytes
Technical information
Page identifier
47769
Contains translations
Yes
Uses parser functions?
Yes
Uses variables?
Yes