Jump to content

Template:MW file

From mediawiki.org
This page is a translated version of the page Template:MW file and the translation is 88% complete.


テンプレートの解説

MediaWiki コアのファイルに関する基礎情報ボックスを表示します。master、安定版、レガシーの各ブランチのソース コードへのリンクと、生成された PHP 説明文書のクラスとインターフェイスへのリンクが含まれます。

{{MW file|FILENAME|PATH
|class1=CLASS
|class2=CLASS
|class3=CLASS
|...
|interface1=INTERFACE
|interface2=INTERFACE
|interface3=INTERFACE
|NotInGit=REASON
}}
  • FILENAME は、拡張子も含むファイル名です。
    • ファイルが最近改名された場合、リンクが動作するよう旧名を指定するために stable=legacy= パラメーターを使用できます。ただし、そのファイル名の変更を含むリリースが master→stable→legacy と移行するにつれて、テンプレート呼び出しを更新する必要があります。
  • PATH はファイルへのパスです。先頭に / を付けず、末尾には / を付けてください。 ルート ディレクトリにあるファイルの場合は空欄のままにしてください。
  • class 引数はすべて省略可能です。指定すると、生成済みの説明文書にリンクされます。 CLASS は、URL 内で使用されるため、クラス名にすべきです。 例:「Parser」を指定すると「classParser.html」へのリンクが生成されます。 このテンプレートではクラスのパラメーターを class1-class6 の 6 個まで指定できます。
  • INTERFACE も同様です。 このテンプレートではインターフェイスのパラメーターを 3 個まで指定できます。
  • NotInGit 引数は省略可能です。何らかの理由でファイルが Git 内にない場合のみ使用してください (作者は、これには LocalSettings.php のみが該当すると考えます)。 REASON は、基礎情報ボックス内に表示される理由です。 NotInGit は大文字・小文字が区別されることにご注意ください!

このテンプレートは、マニュアルで広範囲にわたって使用されています。

{{MW file|index.php|}}


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

{{MW file|WikiPage.php|includes/page/
|class1=MediaWiki\Page\WikiPage
|interface1=MediaWiki\Page\Page
}}

{{MW file|LocalSettings.php|
|NotInGit=インストール時に作成される
}}


{{MW file|includes/Title/Title.php
|stable=includes/title/Title.php
|legacy=includes/title/Title.php
|lts=includes/Title.php
|class1=MediaWiki\Title\Title
}}

関連項目

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.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
File name1

Name of the file, including extension. If the file has been recently renamed, you can use the stable= and the 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.

Example
LocalSettings.php
Stringrequired
File path2

Path to the file; do not include a leading slash, include the trailing slash. Leave it blank for files in the root directory.

Example
includes/libs/
Stringrequired
Not in Git?NotInGit

Whether the version is in Git version control (only rarely used for files like LocalSettings.php and DevelopmentSettings.php). Optional and should only be used if the file is not in Git for some reason. Reason= is the reason that is displayed in the infobox. Note that NotInGit is CASE-SENSITIVE.

Example
created during installation
Stringoptional
Stable MediaWiki versionstable

no description

Unknownoptional
Legacy MediaWiki versionlegacy

no description

Unknownoptional
LTS MediaWiki Versionlts

Long-Term Support version for MediaWiki

Unknownoptional
Class 1class1

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. The template allows up to six class parameters

Example
"Parser" would generate a link to "classParser.html"
Stringsuggested
Class 2class2

no description

Unknownoptional
Class 3class3

no description

Unknownoptional
Class 4class4

no description

Unknownoptional
Class 5class5

no description

Unknownoptional
Class 6class6

no description

Unknownoptional
Interface 1interface1

Similar to Class. The template allows up to three interface parameters.

Unknownsuggested
Interface 2interface2

no description

Unknownoptional
Interface 3interface3

no description

Unknownoptional
Exampleexample

no description

Unknownoptional
nodisplaytitlenodisplaytitle

no description

Unknownoptional