Template:Doc: Difference between revisions
Jump to navigation
Jump to search

Consider discussing changes on the talk page before implementing them.
(Probably wouldn't hurt to pass params to the doc page, if needed) |
(I looked everywhere for that opening span, it probably doesn't have the opening span.) |
||
(21 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{High-use|approx=1,800}} | {{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.}} | |||
{{todo|Decide what to do with the View button on the right side of the "hat".}} | |||
{{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 #505050; background-color:#323232; border-radius:2px; 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:{{ | --><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:{{ | --><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}}}}} | -->{{#switch:{{{pagespace|{{SUBJECTSPACE}}}}} | ||
| #default = {{Doc/strings|documentation}} | | #default = {{Doc/strings|documentation}} | ||
| Template = <span style="{{#switch:{{ | | 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|}}}}} | -->{{#if:{{AVAILABLEDOCPAGENAME|{{{docpage|}}}}} | ||
| [[{{AVAILABLEDOCPAGENAME|{{{docpage|}}}}}|{{Doc/strings|TemplateDoc}} | | '''{{Doc/strings|TemplateDoc}}''' [[[{{AVAILABLEDOCPAGENAME|{{{docpage|}}}}}|{{lc:{{int:View}}}}]]] | ||
| '''{{Doc/strings|TemplateDoc}}''' [[[{{DOCPAGENAME|{{{docpage|}}}}}|{{lc:{{int:View}}}}]]] | |||
}} <!-- | }} <!-- | ||
-->{{#if: {{AVAILABLEDOCPAGENAME|translated=1|{{{docpage|}}}}} | -->{{#if: {{AVAILABLEDOCPAGENAME|translated=1|{{{docpage|}}}}} | ||
Line 35: | Line 36: | ||
-->{{#switch:{{{tools|}}} | -->{{#switch:{{{tools|}}} | ||
| #default = {{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{ | | #default = {{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }} }} | ||
|<!-- | |<!-- | ||
------------------------------ view button ------------------------------ | ------------------------------ view button ------------------------------ | ||
-->{{#if:{{{content{{ | -->{{#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="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; "><!-- | --><div style="position: relative; top: -1.5px; "><!-- | ||
-->[[File:Icon-visibility.png|14px|link={{{docpage|{{FULLPAGENAME}}/doc}}}{{ | -->[[File:Icon-visibility.png|14px|link={{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}} }}|{{int:view}}]]<!-- | ||
--></div><!-- | --></div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 52: | Line 53: | ||
--><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="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; "><!-- | --><div style="position: relative; top: -1.5px; "><!-- | ||
-->[[File:Icon-history.png|14px|link={{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{ | -->[[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><!-- | --></div><!-- | ||
Line 63: | Line 64: | ||
| #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:2px; user-select:none; padding:0 4px">'''…'''</div> | | #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:2px; user-select:none; padding:0 4px">'''…'''</div> | ||
|1= | |1= | ||
}}<!-- ##### switch:TOOLS (2) ##### -- | }}<!-- ##### switch:TOOLS (2) ##### --> | ||
|0= | |0= | ||
}}<!-- ##### switch:TOOLS (1) ##### | }}<!-- ##### switch:TOOLS (1) ##### | ||
Line 72: | Line 73: | ||
------------------------------ dropdown area ------------------------------ | ------------------------------ dropdown area ------------------------------ | ||
--><div style="padding:0.4em 1em;"><!-- | --><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 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 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><!-- | ||
Line 84: | Line 85: | ||
------------------------------ Languages area ------------------------------ | ------------------------------ 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 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}}}{{ | |||
--><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"><!-- | ||
******************** TODO: Probably do a for each thing for flags ******************** | ******************** TODO: Probably do a for each thing for flags ******************** | ||
Line 118: | Line 118: | ||
--></span></div><!-- | --></span></div><!-- | ||
--></div><!-- | --></div><!-- | ||
-->{{#if: {{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{ | -->{{#if: {{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}}} | ||
| | | | ||
| {{metanotice | | {{metanotice | ||
|id=[[File:Info.png|45px]] | |id=[[File:Info.png|45px]] | ||
|rgb=0, 127, 242 | |rgb=0, 127, 242 | ||
|style=padding:7px | |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}}}}} | |text={{Doc/strings|PageNotExist|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}}} | ||
}} | }} | ||
Line 137: | Line 137: | ||
The "if" should be on a new line, or some tags, like == header == wont appear as a header | The "if" should be on a new line, or some tags, like == header == wont appear as a header | ||
--> | --> | ||
{{#if: {{{content{{ | {{#if: {{{content{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}|}}} | ||
| {{{content{{ | | {{{content{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}}}} | ||
| {{#if: {{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{ | | {{#if: {{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}}}} | ||
| {{:{{{docpage|{{FULLPAGENAME}}/doc}}}{{ | | {{:{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}}|1|0}}}} | ||
|DocParam1={{{DocParam1|}}}|DocParam2={{{DocParam2|}}}|DocParam3={{{DocParam3|}}}|DocParam4={{{DocParam4|}}}|DocParam5={{{DocParam5|}}} }} | |DocParam1={{{DocParam1|}}}|DocParam2={{{DocParam2|}}}|DocParam3={{{DocParam3|}}}|DocParam4={{{DocParam4|}}}|DocParam5={{{DocParam5|}}} }} | ||
| {{:{{{docpage|{{FULLPAGENAME}}/doc}}} | | {{:{{{docpage|{{FULLPAGENAME}}/doc}}} | ||
|DocParam1={{{DocParam1|}}}|DocParam2={{{DocParam2|}}}|DocParam3={{{DocParam3|}}}|DocParam4={{{DocParam4|}}}|DocParam5={{{DocParam5|}}} }} | |DocParam1={{{DocParam1|}}}|DocParam2={{{DocParam2|}}}|DocParam3={{{DocParam3|}}}|DocParam4={{{DocParam4|}}}|DocParam5={{{DocParam5|}}} }} | ||
}}<!-- ##### if:PROTECTIONEXPIRY ##### --> | }}<!-- ##### if:PROTECTIONEXPIRY ##### --> | ||
}}<!-- ##### if:CONTENT ##### --> | }}<!-- ##### if:CONTENT ##### --></div></div><!-- | ||
</div></div><!-- | |||
------------------------------ doc/subpage translations | switch function at first line of the template ------------------------------ | ------------------------------ doc/subpage translations | switch function at first line of the template ------------------------------ | ||
-->| 0 = {{ | -->| 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=]] | |||
[[Category: | |||
| 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}}}} | ||
}}<!-- ##### SWITCH FUNCTION, first line of the template ##### | }}<!-- ##### SWITCH FUNCTION, first line of the template ##### | ||
-->{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{ | -->{{#if:{{PROTECTIONEXPIRY:edit|{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}} | ||
|1 | |1 | ||
|0 | |0 | ||
Line 177: | Line 171: | ||
|<div class="plainlinks" style="background:#323232; border:1px solid #505050; border-radius:2px; padding:0.4em 1em; margin-top:1em;"><!-- | |<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}}}}}''<!-- | -->''{{Doc/strings|transcluded|docpage={{{docpage|{{FULLPAGENAME}}/doc}}}}}''<!-- | ||
--> <small>([{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{ | --> <small>([{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}} | ||
|1 | |1 | ||
|0 | |0 | ||
}}<!-- ##### if:PROTECTIONEXPIRY ##### --> | }}<!-- ##### if:PROTECTIONEXPIRY ##### --> | ||
}}<!-- ##### INTLANG ##### --> | }}<!-- ##### INTLANG ##### --> | ||
|action=edit}} {{int:edit}}] {{!}} [{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{ | |action=edit}} {{int:edit}}] {{!}} [{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}{{intlang|pref=/|default-none={{#if:{{PROTECTIONEXPIRY:edit|{{DOCPAGENAME|{{{docpage|}}}}}}} | ||
|1 | |1 | ||
|0 | |0 | ||
Line 188: | Line 182: | ||
}}<!-- ##### INTLANG ##### --> | }}<!-- ##### INTLANG ##### --> | ||
|action=history}} {{int:History}}])</small><br>''{{Doc/strings|Sandbox}}''</div> | |action=history}} {{int:History}}])</small><br>''{{Doc/strings|Sandbox}}''</div> | ||
| | |}}<!-- ##### if:PROTECTIONEXPIRY ##### --></onlyinclude> | ||
}}<!-- ##### if:PROTECTIONEXPIRY ##### --></onlyinclude> | |||
</includeonly>__NOTOC__ | </includeonly>__NOTOC__ |
Latest revision as of 11:01, 1 September 2025

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.
Todo: Decide what to do with the View button on the right side of the "hat".
The above documentation is transcluded from Template:Doc/doc. (Edit | Page history)
Editors can experiment in this template's sandbox (edit) and testcases (edit) pages.
Editors can experiment in this template's sandbox (edit) and testcases (edit) pages.