Difference between revisions of "Template:MW file"
Jump to navigation
Jump to search
Joelmartin (talk | contribs) m (Text replacement - "</translate>" to "") |
Joelmartin (talk | contribs) m (Text replacement - "</>" to "") |
||
(One intermediate revision by the same user not shown) | |||
Line 6: | Line 6: | ||
<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| | + | <th colspan="2">{{ll|Manual:Code| MediaWiki file:}} {{{1}}}</th> |
</tr><tr> | </tr><tr> | ||
− | <td>''' | + | <td>''' Location:'''</td> |
<td>{{{2|/}}}</td> | <td>{{{2|/}}}</td> | ||
</tr><tr valign="top"> | </tr><tr valign="top"> | ||
− | <td>''' | + | <td>''' Source code:'''</td> |
− | <td>{{#if: {{{NotInGit|}}}| | + | <td>{{#if: {{{NotInGit|}}}| not in Git ({{{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]<!-- | ||
• [https://phabricator.wikimedia.org/diffusion/MW/browse/{{MW pre-release release git}}/{{trim|{{{2|}}}}}{{trim|{{{1|}}}}} {{MW pre-release release number}}] --> • [https://phabricator.wikimedia.org/diffusion/MW/browse/{{MW stable release git}}/{{trim|{{{2|}}}}}{{trim|{{{stable|{{{1|index.php}}}}}}}} {{MW stable release number}}] • [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}} || • [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}}] }} | • [https://phabricator.wikimedia.org/diffusion/MW/browse/{{MW pre-release release git}}/{{trim|{{{2|}}}}}{{trim|{{{1|}}}}} {{MW pre-release release number}}] --> • [https://phabricator.wikimedia.org/diffusion/MW/browse/{{MW stable release git}}/{{trim|{{{2|}}}}}{{trim|{{{stable|{{{1|index.php}}}}}}}} {{MW stable release number}}] • [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}} || • [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>''' | + | <td>''' Classes:'''</td> |
<td>{{#if: {{{class1|}}}| {{class doclink|{{trim|{{{class1}}}}}}} }}<!-- | <td>{{#if: {{{class1|}}}| {{class doclink|{{trim|{{{class1}}}}}}} }}<!-- | ||
-->{{#if: {{{class2|}}}| • {{class doclink|{{trim|{{{class2}}}}}}} }}<!-- | -->{{#if: {{{class2|}}}| • {{class doclink|{{trim|{{{class2}}}}}}} }}<!-- | ||
Line 28: | Line 28: | ||
-->{{#if: {{{interface2|}}}| • {{class doclink|{{trim|{{{interface2}}}}}|type=interface}} }}<!-- | -->{{#if: {{{interface2|}}}| • {{class doclink|{{trim|{{{interface2}}}}}|type=interface}} }}<!-- | ||
-->{{#if: {{{interface3|}}}| • {{class doclink|{{trim|{{{interface3}}}}}|type=interface}} }}<!-- | -->{{#if: {{{interface3|}}}| • {{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}}}}} | + | -->{{#if: {{{NotInGit|}}}{{{class1|}}}{{{class2|}}}{{{class3|}}}{{{class4|}}}{{{class5|}}}{{{class6|}}}{{{interface1|}}}{{{interface2|}}}{{{interface3|}}}|| [https://phabricator.wikimedia.org/diffusion/MW/browse/master/?find={{{1|{{BASEPAGENAMEE}}}}} Find code] • [https://doc.wikimedia.org/mediawiki-core/master/php/search.php?query={{{1|{{BASEPAGENAMEE}}}}} Find documentation] <includeonly>[[Category:MediaWiki code pages without class names{{#translation:}}]]</includeonly> }}</td> |
</tr> | </tr> | ||
</table> | </table> | ||
Line 38: | Line 38: | ||
}}<noinclude> | }}<noinclude> | ||
− | == Usage == | + | == 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. | 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. | ||
Line 55: | Line 55: | ||
}} | }} | ||
− | * | + | * ''FILENAME'' is the name of the file, including extension. |
− | ** | + | ** 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. |
− | * | + | * ''PATH'' is the path to the file; do not include a leading slash, include the trailing slash. Leave it blank for files in the root directory. |
− | * | + | * The class arguments are all optional, and if supplied will link to the generated documentation. ''CLASS'' should be the class name, as used in the URL. E.g. "Parser" would generate a link to "classParser.html". The template allows up to six class parameters, <code>class1</code>-<code>class6</code> |
− | * | + | * ''INTERFACE'' is similar. The template allows up to three interface parameters |
− | * | + | * 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). ''REASON'' is the reason that is displayed in the infobox. Note that <code>NotInGit</code> is case sensitive! |
+ | |||
− | + | The [[<tvar|manual>Special:MyLanguage/Manual:Contents|Manual]] uses this template extensively. | |
− | The [[<tvar|manual>Special:MyLanguage/Manual:Contents | ||
− | == Examples == | + | == Examples == |
Line 86: | Line 86: | ||
<pre> | <pre> | ||
{{MW file|LocalSettings.php| | {{MW file|LocalSettings.php| | ||
− | |NotInGit= | + | |NotInGit= created during installation |
}} | }} | ||
</pre> | </pre> | ||
{{MW file|LocalSettings.php| | {{MW file|LocalSettings.php| | ||
− | |NotInGit= | + | |NotInGit= created during installation |
|example=true | |example=true | ||
}} | }} | ||
− | == See also == | + | == See also == |
− | * {{ll|Category:MediaWiki code pages without class names}} - | + | * {{ll|Category:MediaWiki code pages without class names}} - incompletely filled pages are automatically listed by this template |
---- | ---- |
Latest revision as of 15:06, 21 December 2019
MediaWiki file: {{{1}}} | |
---|---|
Location: | / |
Source code: | master • 1.33.1 • 1.32.5 • 1.31.5 |
Classes: | Find code • Find documentation |
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.
{{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.
- 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.
- If the file has been recently renamed, you can use the <tvar|stable>
- PATH is the path to the file; do not include a leading slash, include the trailing slash. Leave it blank for files in the root directory.
- The class arguments are all optional, and if supplied will link to the generated documentation. CLASS should be the class name, as used in the URL. E.g. "Parser" would generate a link to "classParser.html". The template allows up to six class parameters,
class1
-class6
- INTERFACE is similar. The template allows up to three interface parameters
- 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). REASON is the reason that is displayed in the infobox. Note thatNotInGit
is case sensitive!
The [[<tvar|manual>Special:MyLanguage/Manual:Contents|Manual]] uses this template extensively.
Examples
{{MW file|index.php|}}
MediaWiki file: index.php | |
---|---|
Location: | |
Source code: | master • 1.33.1 • 1.32.5 • 1.31.5 |
Classes: | Find code • Find documentation |
{{MW file|Article.php|includes/page/ |class1=Article }}
MediaWiki file: Article.php | |
---|---|
Location: | includes/page/ |
Source code: | master • 1.33.1 • 1.32.5 • 1.31.5 |
Classes: | Article |
{{MW file|LocalSettings.php| |NotInGit= created during installation }}
MediaWiki file: LocalSettings.php | |
---|---|
Location: | |
Source code: | not in Git (created during installation) |
Classes: |
See also
- Category:MediaWiki code pages without class names - incompletely filled pages are automatically listed by this template
Maintenance: noslash