Difference between revisions of "Template:MW file"

From RobotX
Jump to navigation Jump to search
m (1 revision imported)
m (Text replacement - "<translate>" to "")
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
 
<languages/>
 
<languages/>
</noinclude>{{#switch:<translate></translate>
+
</noinclude>{{#switch:</translate>
 
| =
 
| =
 
<includeonly><span style="display:none">{{#ifeq:{{PAGENAME}}|{{BASEPAGENAME}}|{{DISPLAYTITLE:{{NAMESPACE}}:{{{1}}}}}}}</span></includeonly>
 
<includeonly><span style="display:none">{{#ifeq:{{PAGENAME}}|{{BASEPAGENAME}}|{{DISPLAYTITLE:{{NAMESPACE}}:{{{1}}}}}}}</span></includeonly>
 
<table style="background: #fff; border:1px solid #a2a9b1; margin: 1em auto;" cellpadding="5" cellspacing="0" class="plainlinks">
 
<table style="background: #fff; border:1px solid #a2a9b1; margin: 1em auto;" cellpadding="5" cellspacing="0" class="plainlinks">
 
<tr style="background: #eaecf0; text-align:center;">
 
<tr style="background: #eaecf0; text-align:center;">
<th colspan="2">{{ll|Manual:Code|<translate><!--T:1--> MediaWiki file:</translate>}} {{{1}}}</th>
+
<th colspan="2">{{ll|Manual:Code|<!--T:1--> MediaWiki file:</translate>}} {{{1}}}</th>
 
</tr><tr>
 
</tr><tr>
<td>'''<translate><!--T:2--> Location:</translate>'''</td>
+
<td>'''<!--T:2--> Location:</translate>'''</td>
 
<td>{{{2|/}}}</td>
 
<td>{{{2|/}}}</td>
 
</tr><tr valign="top">
 
</tr><tr valign="top">
<td>'''<translate><!--T:3--> Source code:</translate>'''</td>
+
<td>'''<!--T:3--> Source code:</translate>'''</td>
<td>{{#if: {{{NotInGit|}}}|<translate><!--T:4--> not in Git</translate> ({{{NotInGit}}})|
+
<td>{{#if: {{{NotInGit|}}}|<!--T:4--> not in Git</translate> ({{{NotInGit}}})|
 
[https://phabricator.wikimedia.org/diffusion/MW/browse/master/{{trim|{{{2|}}}}}{{trim|{{{1|index.php}}}}} master]<!--
 
[https://phabricator.wikimedia.org/diffusion/MW/browse/master/{{trim|{{{2|}}}}}{{trim|{{{1|index.php}}}}} master]<!--
 
&bull; [https://phabricator.wikimedia.org/diffusion/MW/browse/{{MW pre-release release git}}/{{trim|{{{2|}}}}}{{trim|{{{1|}}}}} {{MW pre-release release number}}] --> &bull; [https://phabricator.wikimedia.org/diffusion/MW/browse/{{MW stable release git}}/{{trim|{{{2|}}}}}{{trim|{{{stable|{{{1|index.php}}}}}}}} {{MW stable release number}}] &bull; [https://phabricator.wikimedia.org/diffusion/MW/browse/{{MW legacy release git}}/{{trim|{{{2|}}}}}{{trim|{{{legacy|{{{stable|{{{1|index.php}}}}}}}}}}} {{MW legacy release number}}] {{ #ifeq: {{MW legacy release number}} | {{MW legacy lts release number}} || &bull; [https://phabricator.wikimedia.org/diffusion/MW/browse/{{MW legacy lts release git}}/{{trim|{{{2|}}}}}{{trim|{{{lts|{{{legacy|{{{stable|{{{1|index.php}}}}}}}}}}}}}} {{MW legacy lts release number}}] }}
 
&bull; [https://phabricator.wikimedia.org/diffusion/MW/browse/{{MW pre-release release git}}/{{trim|{{{2|}}}}}{{trim|{{{1|}}}}} {{MW pre-release release number}}] --> &bull; [https://phabricator.wikimedia.org/diffusion/MW/browse/{{MW stable release git}}/{{trim|{{{2|}}}}}{{trim|{{{stable|{{{1|index.php}}}}}}}} {{MW stable release number}}] &bull; [https://phabricator.wikimedia.org/diffusion/MW/browse/{{MW legacy release git}}/{{trim|{{{2|}}}}}{{trim|{{{legacy|{{{stable|{{{1|index.php}}}}}}}}}}} {{MW legacy release number}}] {{ #ifeq: {{MW legacy release number}} | {{MW legacy lts release number}} || &bull; [https://phabricator.wikimedia.org/diffusion/MW/browse/{{MW legacy lts release git}}/{{trim|{{{2|}}}}}{{trim|{{{lts|{{{legacy|{{{stable|{{{1|index.php}}}}}}}}}}}}}} {{MW legacy lts release number}}] }}
 
}}</td>
 
}}</td>
 
</tr><tr valign="top">
 
</tr><tr valign="top">
<td>'''<translate><!--T:5--> Classes:</translate>'''</td>
+
<td>'''<!--T:5--> Classes:</translate>'''</td>
 
<td>{{#if: {{{class1|}}}| {{class doclink|{{trim|{{{class1}}}}}}} }}<!--
 
<td>{{#if: {{{class1|}}}| {{class doclink|{{trim|{{{class1}}}}}}} }}<!--
 
-->{{#if: {{{class2|}}}| &nbsp;&bull; {{class doclink|{{trim|{{{class2}}}}}}} }}<!--
 
-->{{#if: {{{class2|}}}| &nbsp;&bull; {{class doclink|{{trim|{{{class2}}}}}}} }}<!--
Line 28: Line 28:
 
-->{{#if: {{{interface2|}}}| &bull; {{class doclink|{{trim|{{{interface2}}}}}|type=interface}} }}<!--
 
-->{{#if: {{{interface2|}}}| &bull; {{class doclink|{{trim|{{{interface2}}}}}|type=interface}} }}<!--
 
-->{{#if: {{{interface3|}}}| &bull; {{class doclink|{{trim|{{{interface3}}}}}|type=interface}} }}<!--
 
-->{{#if: {{{interface3|}}}| &bull; {{class doclink|{{trim|{{{interface3}}}}}|type=interface}} }}<!--
-->{{#if: {{{NotInGit|}}}{{{class1|}}}{{{class2|}}}{{{class3|}}}{{{class4|}}}{{{class5|}}}{{{class6|}}}{{{interface1|}}}{{{interface2|}}}{{{interface3|}}}|| [https://phabricator.wikimedia.org/diffusion/MW/browse/master/?find={{{1|{{BASEPAGENAMEE}}}}} <translate><!--T:29--> Find code</translate>] &bull; [https://doc.wikimedia.org/mediawiki-core/master/php/search.php?query={{{1|{{BASEPAGENAMEE}}}}} <translate><!--T:30--> Find documentation</translate>] <includeonly>[[Category:MediaWiki code pages without class names{{#translation:}}]]</includeonly> }}</td>
+
-->{{#if: {{{NotInGit|}}}{{{class1|}}}{{{class2|}}}{{{class3|}}}{{{class4|}}}{{{class5|}}}{{{class6|}}}{{{interface1|}}}{{{interface2|}}}{{{interface3|}}}|| [https://phabricator.wikimedia.org/diffusion/MW/browse/master/?find={{{1|{{BASEPAGENAMEE}}}}} <!--T:29--> Find code</translate>] &bull; [https://doc.wikimedia.org/mediawiki-core/master/php/search.php?query={{{1|{{BASEPAGENAMEE}}}}} <!--T:30--> Find documentation</translate>] <includeonly>[[Category:MediaWiki code pages without class names{{#translation:}}]]</includeonly> }}</td>
 
</tr>
 
</tr>
 
</table>
 
</table>
Line 37: Line 37:
 
   {{#invoke:Template translation|renderTranslatedTemplate|template=Template:MW file|noshift=1}}
 
   {{#invoke:Template translation|renderTranslatedTemplate|template=Template:MW file|noshift=1}}
 
}}<noinclude>
 
}}<noinclude>
<translate>
+
 
 
== Usage == <!--T:7-->
 
== Usage == <!--T:7-->
  
Line 55: Line 55:
 
  }}
 
  }}
  
* <translate><!--T:8--> ''FILENAME'' is the name of the file, including extension.</translate>
+
* <!--T:8--> ''FILENAME'' is the name of the file, including extension.</translate>
** <translate><!--T:9--> If the file has been recently renamed, you can use the <tvar|stable><code>stable=</code></> and the <tvar|legacy><code>legacy=</code></> parameters to provide the old name so links work; you'll need to update the template invocation as the release in which the file was renamed moves from master->stable->legacy.</translate>
+
** <!--T:9--> If the file has been recently renamed, you can use the <tvar|stable><code>stable=</code></> and the <tvar|legacy><code>legacy=</code></> parameters to provide the old name so links work; you'll need to update the template invocation as the release in which the file was renamed moves from master->stable->legacy.</translate>
* <translate><!--T:10--> ''PATH'' is the path to the file; do not include a leading slash, include the trailing slash.</translate> <translate><!--T:20--> Leave it blank for files in the root directory.</translate>
+
* <!--T:10--> ''PATH'' is the path to the file; do not include a leading slash, include the trailing slash.</translate> <!--T:20--> Leave it blank for files in the root directory.</translate>
* <translate><!--T:11--> The class arguments are all optional, and if supplied will link to the generated documentation.</translate> <translate><!--T:21--> ''CLASS'' should be the class name, as used in the URL.</translate> <translate><!--T:12--> E.g. "Parser" would generate a link to "classParser.html".</translate> <translate><!--T:27--> The template allows up to six class parameters, <code>class1</code>-<code>class6</code></translate>
+
* <!--T:11--> The class arguments are all optional, and if supplied will link to the generated documentation.</translate> <!--T:21--> ''CLASS'' should be the class name, as used in the URL.</translate> <!--T:12--> E.g. "Parser" would generate a link to "classParser.html".</translate> <!--T:27--> The template allows up to six class parameters, <code>class1</code>-<code>class6</code></translate>
* <translate><!--T:13--> ''INTERFACE'' is similar.</translate> <translate><!--T:28--> The template allows up to three interface parameters</translate>
+
* <!--T:13--> ''INTERFACE'' is similar.</translate> <!--T:28--> The template allows up to three interface parameters</translate>
* <translate><!--T:14--> The <code>NotInGit</code> argument is optional and should only be used if the file is not in [[<tvar|git>Special:MyLanguage/Git</>|Git]] for some reason (I think this only applies to LocalSettings.php).</translate> <translate><!--T:24--> ''REASON'' is the reason that is displayed in the infobox.</translate> <translate><!--T:25--> Note that <code>NotInGit</code> is case sensitive!</translate>
+
* <!--T:14--> The <code>NotInGit</code> argument is optional and should only be used if the file is not in [[<tvar|git>Special:MyLanguage/Git</>|Git]] for some reason (I think this only applies to LocalSettings.php).</translate> <!--T:24--> ''REASON'' is the reason that is displayed in the infobox.</translate> <!--T:25--> Note that <code>NotInGit</code> is case sensitive!</translate>
 +
 
  
<translate>
 
 
<!--T:16-->
 
<!--T:16-->
 
The [[<tvar|manual>Special:MyLanguage/Manual:Contents</>|Manual]] uses this template extensively.
 
The [[<tvar|manual>Special:MyLanguage/Manual:Contents</>|Manual]] uses this template extensively.
Line 86: Line 86:
 
<pre>
 
<pre>
 
{{MW file|LocalSettings.php|
 
{{MW file|LocalSettings.php|
|NotInGit=<translate><!--T:18--> created during installation</translate>
+
|NotInGit=<!--T:18--> created during installation</translate>
 
}}
 
}}
 
</pre>
 
</pre>
 
{{MW file|LocalSettings.php|
 
{{MW file|LocalSettings.php|
|NotInGit=<translate><!--T:19--> created during installation</translate>
+
|NotInGit=<!--T:19--> created during installation</translate>
 
|example=true
 
|example=true
 
}}
 
}}
  
<translate>
+
 
 
== See also == <!--T:31-->
 
== See also == <!--T:31-->
 
</translate>
 
</translate>
* {{ll|Category:MediaWiki code pages without class names}} - <translate><!--T:32--> incompletely filled pages are automatically listed by this template</translate>
+
* {{ll|Category:MediaWiki code pages without class names}} - <!--T:32--> incompletely filled pages are automatically listed by this template</translate>
  
 
----
 
----

Revision as of 04:11, 21 December 2019


Usage

Displays an informative box about a file in MediaWiki core, with links to its source code in master, stable, and legacy branches, and links to its classes and interfaces in the generated PHP documentation. </translate>

{{MW file|FILENAME|PATH
|class1=CLASS
|class2=CLASS
|class3=CLASS
|...
|interface1=INTERFACE
|interface2=INTERFACE
|interface3=INTERFACE
|NotInGit=REASON
}}
  • FILENAME is the name of the file, including extension.</translate>
    • If the file has been recently renamed, you can use the <tvar|stable>stable=</> and the <tvar|legacy>legacy=</> parameters to provide the old name so links work; you'll need to update the template invocation as the release in which the file was renamed moves from master->stable->legacy.</translate>
  • PATH is the path to the file; do not include a leading slash, include the trailing slash.</translate> Leave it blank for files in the root directory.</translate>
  • The class arguments are all optional, and if supplied will link to the generated documentation.</translate> CLASS should be the class name, as used in the URL.</translate> E.g. "Parser" would generate a link to "classParser.html".</translate> The template allows up to six class parameters, class1-class6</translate>
  • INTERFACE is similar.</translate> The template allows up to three interface parameters</translate>
  • The NotInGit argument is optional and should only be used if the file is not in [[<tvar|git>Special:MyLanguage/Git</>|Git]] for some reason (I think this only applies to LocalSettings.php).</translate> REASON is the reason that is displayed in the infobox.</translate> Note that NotInGit is case sensitive!</translate>


The [[<tvar|manual>Special:MyLanguage/Manual:Contents</>|Manual]] uses this template extensively.

Examples

</translate>

{{MW file|index.php|}}

{{MW file|Article.php|includes/page/
|class1=Article
}}

{{MW file|LocalSettings.php|
|NotInGit=<!--T:18--> created during installation</translate>
}}


See also

</translate>


Maintenance: noslash