Difference between revisions of "Template:MW file"

From RobotX
Jump to navigation Jump to search
m (Text replacement - "<!--T:(.*)-->" to "")
m (Text replacement - "</>" to "")
 
Line 56: Line 56:
  
 
*  ''FILENAME'' is the name of the file, including extension.
 
*  ''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.
+
**  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.
 
*  ''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>
 
*  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
 
*  ''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 <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|Manual]] uses this template extensively.
  
 
== Examples ==  
 
== Examples ==  

Latest revision as of 15:06, 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.


{{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.
  • 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 that NotInGit is case sensitive!


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

Examples

{{MW file|index.php|}}

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

{{MW file|LocalSettings.php|
|NotInGit= created during installation
}}


See also


Maintenance: noslash