Template:Doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Improved Template:Documentation with support for displaying documentation in the desired language, staying on the same page.)
 
No edit summary
 
(216 intermediate revisions by 16 users not shown)
Line 1: Line 1:
<onlyinclude><includeonly>{{#switch:{{{1|}}}
{{High-use|approx=1,800}}
|#default=<span class="mw-editsection plainlinks" style=float:right><table cellspacing=0 style="width:100%;margin-bottom:-1px;"><tr>
{{todo|Exclude Sandbox subpage and other from this template. Also do some code cleanup.}}
{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}
{{todo|Make this code less shitty.}}
|{{#if:{{{content{{uilang|/}}|}}}||<td style="border-left:1px solid;border-image:linear-gradient(to top,#AAA,transparent 100%) 1 100%;text-align:center;padding:8px;background:linear-gradient(0,#323232 50%,transparent 100%)">[[{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}|{{int:view}}]]</td>
{{doc}}
<td style="text-align:center;padding:8px;background:linear-gradient(0,#323232 50%,transparent 100%)">[{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}|action=edit}} {{int:edit}}]</td>
<includeonly>
<td style="text-align:center;padding:8px;background:linear-gradient(0,#323232 50%,transparent 100%);border-right-width:1px;border-right-style:solid;border-image:linear-gradient(to top,#AAA,transparent 100%) 1 100%">[{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}|action=history}} {{int:history}}]</td>}}
 
<td class="mw-collapsible mw-collapsed" id="mw-customcollapsible-doctools" style="text-align:center;padding:8px;border-bottom:1px solid">{{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/sandbox}}| [[{{FULLPAGENAME}}/sandbox|{{#switch:{{uilang}}|#default=Sandbox|ru=Песочница}}]] | [{{fullurl:{{FULLPAGENAME}}/sandbox|action=edit&preload={{urlencode:{{FULLPAGENAME}}}}}} {{#switch:{{uilang}}|#default=Sandbox|ru=Песочница}}]}}</td>
<onlyinclude>{{Doc/templateusecategory}}{{#if:{{{content|}}}|[[Category:Documentation using content parameter]]}}{{ulf|all-lang=1}}{{#switch:{{{1|}}}
<td class="mw-collapsible mw-collapsed" id="mw-customcollapsible-doctools" style="text-align:center;padding:8px;border-bottom:1px solid">{{#if:{{PROTECTIONEXPIRY:edit|{{FULLPAGENAME}}/testcases}}| [[{{FULLPAGENAME}}/testcases|{{#switch:{{uilang}}|#default=Testcase|ru=Тестирование}}]] | [{{fullurl:{{FULLPAGENAME}}/testcases|action=edit}} {{#switch:{{uilang}}|#default=Testcase|ru=Тестирование}}]}}</td>
| #default = <div style="clear:both; margin-top:1em; border:1px solid #4F4F4F; background-color:#323232; border-radius:.3em; scrollbar-color: #686868 #424242 !important;"><!--
|{{#if:{{{content{{uilang|/}}|}}}||<td style="text-align:center;padding:8px;background:linear-gradient(0,#323232 50%,transparent 100%);border-left:1px solid;border-right:1px solid;border-image:linear-gradient(to top,#AAA,transparent 100%) 1 100%">[{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}|action=edit}} {{int:create}}]</td>}}
--><div style="width:100%"><!--
}}
--><div style="display:flex; gap:8px; background:#4F4F4F; padding:.5em .55em .55em .8em; flex-direction:{{#switch:{{intlang}}|he=row-reverse| align=right|#default=row}}"><!--
<td class="mw-collapsible mw-collapsed" id="mw-customcollapsible-doctools" style="text-align:center;padding:8px;border-bottom:1px solid">[[Special:PrefixIndex/{{FULLPAGENAME}}/|{{#switch:{{uilang}}|#default=Subpages|ru=Под&shy;страницы}}]]</td>
--><div style="display:flex; flex-direction:{{#switch:{{intlang}}|he=row-reverse|#default=row}}; align-items:center; font-size:1.2em; color:#D8D8D8;"><!--
<td class="mw-collapsible mw-collapsed" id="mw-customcollapsible-doctools" style="text-align:center;padding:8px;border-bottom:1px solid">[{{fullurl:{{FULLPAGENAME}}|action=purge}} {{#switch:{{uilang}}|#default=Purge|es=Purga|ru=Очистить кэш|zh-cn=清除缓存(刷新页面)|ka=წმენდს}}]</td>
-->{{#switch:{{{pagespace|{{SUBJECTSPACE}}}}}
<td class="mw-collapsible" id="mw-customcollapsible-doctools" style="padding:8px;border-bottom:1px solid">&ensp;</td>
| #default = {{Doc/strings|documentation}}
<td class="mw-customtoggle-doctools" style="padding:8px;background:linear-gradient(0,#323232 50%,transparent 100%);border-left:1px solid;border-right:1px solid;border-image:linear-gradient(to top,#AAA,transparent 100%) 1 100%">'''…'''</td>
| 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><!--
</tr></table></span>
-->{{#if:{{AVAILABLEDOCPAGENAME|{{{docpage|}}}}}
<div style="clear:both;margin-top:1em;border:1px solid #AAA;background:#323232;padding:1em">
| '''{{Doc/strings|TemplateDoc}}'''&nbsp;&#91;[[{{AVAILABLEDOCPAGENAME|{{{docpage|}}}}}|{{lc:{{int:View}}}}]]&#93;
<table cellspacing=0 width=100% style="margin:3px 0 10px 0;background:#323232">
| '''{{Doc/strings|TemplateDoc}}'''&nbsp;&#91;[[{{DOCPAGENAME|{{{docpage|}}}}}|{{lc:{{int:View}}}}]]&#93;
<tr><td rowspan=2 style="border-bottom:1px solid #AAA;padding-bottom:3px;font-weight:bold;font-size:125%">{{#switch:{{{pagespace|{{SUBJECTSPACE}}}}}
}}&nbsp;<!--
|#default={{#switch:{{uilang}}|#default=Documentation|de=Dokumentation|es=Documentación|ru=Документация|zh-cn=文档}}
-->{{#if: {{AVAILABLEDOCPAGENAME|translated=1|{{{docpage|}}}}}
|Template=[[File:Curly_brackets_white.png|40px|link=]] {{#switch:{{uilang}}|#default=Template Documentation|es=Documentación de las plantillas|ru=Документация шаблона|zh-cn=模板文档|ka=თარგი დოკუმენტაცია}}
| [{{PageCreateLink|create={{DOCPAGENAME|{{{docpage|}}}}}|alt={{lc:{{int:Edit}}}}}}]
|File={{#switch:{{uilang}}|#default=Summary|es=Resumen|ru=Описание|zh-cn=摘要}}
| {{#if: {{AVAILABLEDOCPAGENAME|{{{docpage|}}}}}  
}}</td>{{#if:{{{nolang|}}}||<td></td></tr>
| [{{PageCreateLink|create={{BASEDOCPAGENAME|{{{docpage|}}}}}|alt={{lc:{{int:Edit}}}}}}]<!--
<tr><td style="width:480px;height:19px;border:1px solid #AAA;border-bottom:0"><!--
--> [{{PageCreateLink|create={{DOCPAGENAME|{{{docpage|}}}}}|preload=Doc/preload{{intlang|pref=/}}|alt={{lc:{{int:create}}}}}}&nbsp;{{Flag|{{intlang}}}}]
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}||#AAA">[[Category:English]]|{{#if:{{{content|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:En.png|link={{#ifeq:{{uilang}}|||{{fullurl:{{FULLPAGENAME}}|uselang=en}}}}|English]]</span><!--
| [{{PageCreateLink|create={{DOCPAGENAME|{{{docpage|}}}}}|preload=Doc/preload{{intlang|pref=/|default-none=1}}|alt={{lc:{{int:create}}}}}}]
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|ca|#AAA">[[Category:Catalan]]|{{#if:{{{content/ca|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Ca.png|link={{#ifeq:{{uilang}}|ca||{{fullurl:{{FULLPAGENAME}}|uselang=ca}}}}|Català]]</span><!--
}}
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|cs|#AAA">[[Category:Czech]]|{{#if:{{{content/cs|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Cz.png|link={{#ifeq:{{uilang}}|cs||{{fullurl:{{FULLPAGENAME}}|uselang=cs}}}}|Čeština]]</span><!--
}}
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|de|#AAA">[[Category:German]]|{{#if:{{{content/de|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:De.png|link={{#ifeq:{{uilang}}|de||{{fullurl:{{FULLPAGENAME}}|uselang=de}}}}|Deutsch]]</span><!--
| File = {{Doc/strings|Summary}}
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|es|#AAA">[[Category:Spanish]]|{{#if:{{{content/es|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Es.png|link={{#ifeq:{{uilang}}|es||{{fullurl:{{FULLPAGENAME}}|uselang=es}}}}|Español]]</span><!--
| User = {{Doc/strings|About}}
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|et|#AAA">[[Category:Estonian]]|{{#if:{{{content/et|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Et.png|link={{#ifeq:{{uilang}}|et||{{fullurl:{{FULLPAGENAME}}|uselang=et}}}}|Eesti]]</span><!--
}}</div><!--
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|fr|#AAA">[[Category:French]]|{{#if:{{{content/fr|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Fr.png|link={{#ifeq:{{uilang}}|fr||{{fullurl:{{FULLPAGENAME}}|uselang=fr}}}}|Français]]</span><!--
--><div style="display:flex; gap:6px; margin-left:auto"><!--
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|hu|#AAA">[[Category:Hungarian]]|{{#if:{{{content/hu|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Hu.png|link={{#ifeq:{{uilang}}|hu||{{fullurl:{{FULLPAGENAME}}|uselang=hu}}}}|Magyar]]</span><!--
 
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|it|#AAA">[[Category:Italian]]|{{#if:{{{content/it|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:It.png|link={{#ifeq:{{uilang}}|it||{{fullurl:{{FULLPAGENAME}}|uselang=it}}}}|Italiano]]</span><!--
    ------------------------------ Language button ------------------------------
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|nl|#AAA">[[Category:Dutch]]|{{#if:{{{content/nl|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Nl.png|link={{#ifeq:{{uilang}}|nl||{{fullurl:{{FULLPAGENAME}}|uselang=nl}}}}|Nederlands]]</span><!--
 
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|no|#AAA">[[Category:Norwegian]]|{{#if:{{{content/no|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:No.png|link={{#ifeq:{{uilang}}|no||{{fullurl:{{FULLPAGENAME}}|uselang=no}}}}|Norsk]]</span><!--
--><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><!--
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|pl|#AAA">[[Category:Polish]]|{{#if:{{{content/pl|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Pl.png|link={{#ifeq:{{uilang}}|pl||{{fullurl:{{FULLPAGENAME}}|uselang=pl}}}}|Polski]]</span><!--
 
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|pt|#AAA">[[Category:Portuguese]]|{{#if:{{{content/pt|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Pt.png|link={{#ifeq:{{uilang}}|pt||{{fullurl:{{FULLPAGENAME}}|uselang=pt}}}}|Português]]</span><!--
-->{{#switch:{{{tools|}}}
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|pt-br|#AAA">[[Category:Brazilian Portuguese]]|{{#if:{{{content/pt-br|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Pt-br.png|link={{#ifeq:{{uilang}}|pt-br||{{fullurl:{{FULLPAGENAME}}|uselang=pt-br}}}}|Português-Brasileiro]]</span><!--
| #default = {{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }} }}
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|ru|#AAA">[[Category:Russian]]|{{#if:{{{content/ru|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Ru.png|link={{#ifeq:{{uilang}}|ru||{{fullurl:{{FULLPAGENAME}}|uselang=ru}}}}|Русский]]</span><!--
|<!--  
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|uk|#AAA">[[Category:Ukrainian]]|{{#if:{{{content/uk|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Ua.png|link={{#ifeq:{{uilang}}|uk||{{fullurl:{{FULLPAGENAME}}|uselang=uk}}}}|Українська]]</span><!--
 
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|sv|#AAA">[[Category:Swedish]]|{{#if:{{{content/sv|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Se.png|link={{#ifeq:{{uilang}}|sv||{{fullurl:{{FULLPAGENAME}}|uselang=sv}}}}|Svenska]]</span><!--
------------------------------ view button ------------------------------
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|tr|#AAA">[[Category:Turkish]]|{{#if:{{{content/tr|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Tr.png|link={{#ifeq:{{uilang}}|tr||{{fullurl:{{FULLPAGENAME}}|uselang=tr}}}}|Türkçe]]</span><!--
 
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|ja|#AAA">[[Category:Japanese]]|{{#if:{{{content/ja|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Jp.png|link={{#ifeq:{{uilang}}|ja||{{fullurl:{{FULLPAGENAME}}|uselang=ja}}}}|日本語]]</span><!--
-->{{#if:{{{content{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }}| }}}
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|zh-cn|#AAA">[[Category:Simplified Chinese]]|{{#if:{{{content/zh-cn|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Cn.png|link={{#ifeq:{{uilang}}|zh-cn||{{fullurl:{{FULLPAGENAME}}|uselang=zh-cn}}}}|简体中文]]</span><!--
|
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|zh-tw|#AAA">[[Category:Taiwanese Mandarin]]|{{#if:{{{content/zh-tw|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Tw.png|link={{#ifeq:{{uilang}}|zh-tw||{{fullurl:{{FULLPAGENAME}}|uselang=zh-tw}}}}|正體中文]]</span><!--
|<!--
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|ko|#AAA">[[Category:Korean]]|{{#if:{{{content/ko|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Ko.png|link={{#ifeq:{{uilang}}|ko||{{fullurl:{{FULLPAGENAME}}|uselang=ko}}}}|한국어]]</span><!--
 
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|ka|#AAA">[[Category:Georgian]]|{{#if:{{{content/ka|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:Ka.png|link={{#ifeq:{{uilang}}|ka||{{fullurl:{{FULLPAGENAME}}|uselang=ka}}}}|ქართული ენა]]</span><!--
------------------------------ history button ------------------------------
--><span style="margin:1px;border:1px solid {{#ifeq:{{uilang}}|he|#AAA">[[Category:Hebrew]]|{{#if:{{{content/he|}}}|#323232|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}|#323232|#552020;background:#552020}}}}">}}[[File:He.png|link={{#ifeq:{{uilang}}|he||{{fullurl:{{FULLPAGENAME}}|uselang=he}}}}|עִברִית]]</span></td>}}</tr>
 
{{#if:{{{examples|}}}|<tr style=float:left><td class="mw-customtoggle-docexamples mw-editsection plainlinks" style="border-left:1px solid;border-right:1px solid;border-bottom:1px solid;padding:3px">{{int:apisandbox-examples}}</td></tr></table>
--><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 class="mw-collapsible mw-collapsed" id="mw-customcollapsible-docexamples" style="margin-bottom:4px;display:inline-block;border:1px solid;padding:4px"><code style=padding:0>{{{examples}}}</code></div>|</table>}}
--><div style="position: relative; top:-1.5px; "><!--
{{{content{{uilang|/}}|{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}
-->[[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}}]]<!--
|{{:{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}}}
--></div><!--
|{{messagebox|style=margin-top:14px|text={{#switch:{{uilang}}|#default=The <span style=text-decoration:underline>'''{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}'''</span> documentation page does not exist.|ru=Страница документации <span style=text-decoration:underline>'''{{{docpage|{{FULLPAGENAME}}/doc}}}{{uilang|/}}'''</span> не существует.}}}}
--></div><!--
}}}}}
-->}}<!-- ##### if:PROTECTIONEXPIRY #####
</div>
-->}}<!-- ##### if:CONTENT #####  
|0={{messagebox|borderstyle=|image=[[File:Edit-copy.png|40px|link=]]
 
|text={{#switch:{{uilang}}|#default=This is a documentation subpage for [[{{{page|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}}]].|de=Dies ist eine Unterseite zur Dokumentation für [[{{{page|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}}]].|es=Esta es una subpágina de documentación para [[{{{page|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}}]].|ru=Это подстраница документации для [[{{{page|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}}]].|zh-cn=这是 [[{{{page|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}}]] 的文档子页面。|ka=ეს არის დოკუმენტაცია [[{{{page|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}}]].}}}}[[Category:Documentation pages]]
------------------------------ more options button (...) ------------------------------
|1={{messagebox|borderstyle=|image=[[File:Sandbox.png|40px|link=]]
 
|text={{#switch:{{uilang}}|#default=This is the sandbox subpage for [[{{{page|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}}]].|es=Esta es una subpágina de caja de arena para [[{{{page|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}}]].|ru=Это подстраница песочницы для [[{{{page|{{SUBJECTSPACE}}:{{BASEPAGENAME}}}}}]].}} ([{{fullurl:Special:ComparePages|page1={{NAMESPACEE}}:{{BASEPAGENAMEE}}&page2={{FULLPAGENAMEE}}}} {{#switch:{{uilang}}|#default=diff|ru=Сравнить}}])}}[[Category:Sandbox pages]]
-->{{#switch:{{{tools|}}}
|2={{messagebox|borderstyle=|image=[[File:Sandbox Not.png|40px|link=]]
| #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>
|text={{#switch:{{uilang}}|#default=This page is ''not'' a sandbox.|ru=Эта страница ''не является'' песочницей.}}
|1=
|small={{#switch:{{uilang}}|#default=It should not be used for test editing. To experiment, please use your [[Special:MyPage/sandbox|user sandbox]], or the [[:Category:Sandbox pages|other sandboxes]].|ru=Не используйте её для тестовых правок. Экспериментируйте в [[Special:MyPage/sandbox|своей]] или [[:Category:Sandbox pages|других песочницах]].}}}}
}}<!-- ##### switch:TOOLS (2) ##### -->
}}</includeonly></onlyinclude>
|0=
{{doc|examples=<nowiki>{{doc}}</nowiki><br><nowiki>{{doc|0}}</nowiki><br><nowiki>{{doc|1}}</nowiki><br><nowiki>{{doc|2}}</nowiki>}}
}}<!-- ##### switch:TOOLS (1) #####
--></div><!--
--></div><!--
--></div><!--
 
------------------------------ dropdown area ------------------------------
 
--><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; "><!--
--><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: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>{{#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><!--
--></div><!--  
 
------------------------------ 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|eo|Esperanto|content={{{content/eo|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|ca|Catalan|content={{{content/ca|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|cs|Czech|content={{{content/cs|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|de|German|content={{{content/de|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|es|Spanish|content={{{content/es|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|et|Estonian|content={{{content/et|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|fr|French|content={{{content/fr|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|hr|Croatian|content={{{content/hr|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|hu|Hungarian|content={{{content/hu|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|it|Italian|content={{{content/it|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|nl|Dutch|content={{{content/nl|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|no|Norwegian|content={{{content/no|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|pl|Polish|content={{{content/pl|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|pt|Portuguese|content={{{content/pt|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|pt-br|Brazilian Portuguese|content={{{content/pt-br|}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|ru|Russian|content={{{content|ru}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|uk|Ukrainian|content={{{content|uk}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|sv|Swedish|content={{{content|sv}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|tr|Turkish|content={{{content|tr}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|ja|Japanese|content={{{content|ja}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|vi|Vietnamese|content={{{content|vi}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|zh|Chinese|content={{{content|zh}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|zh-tw|Taiwanese Mandarin|content={{{content|zh-tw}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|ko|Korean|content={{{content|ko}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|ka|Georgian|content={{{content|ka}}}}}</div><!--
--><div>{{Doc/flag|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}|show-lang-name=1|he|Hebrew|content={{{content|he}}}}}</div><!--
 
--></span></div><!--
--></div><!--
-->{{#if: {{PROTECTIONEXPIRY:edit|{{{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; 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 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><!--
 
------------------------------ doc/subpage translations | switch function at first line of the template ------------------------------
 
-->| 0 = {{doc/subpage/0usecheck}}{{Doc/subpage}}[[Category:Pages using deprecated Doc 0]]
| 4 = {{doc/subpage/4usecheck}}{{Doc/multi-subpage}}[[Category:Pages using deprecated Doc 4]]
<!-- Not being used -->
| 1 = {{doc/subpage/1usecheck}}{{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]]
| 2 = {{doc/subpage/2usecheck}}{{messagebox|borderstyle=|image=[[File:Sandbox Not.png|40px|link=]]
|text={{Doc/strings|NotSandbox 1}}}}
|small={{Doc/strings|NotSandbox 2}}
| 3 = {{doc/subpage/3usecheck}}{{messagebox|borderstyle=|image=[[File:Edit-copy.png|40px|link=]]
|text={{Doc/strings|Infosp}}}}
 
}}<!-- ##### SWITCH FUNCTION, first line of the template #####
 
-->{{#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__

Latest revision as of 07: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 it's 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
20251014075018
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