Module:Version/doc/en: Difference between revisions
Appearance
Content deleted Content added
Updating to match new version of source page |
Updating to match new version of source page |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 7: | Line 7: | ||
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> |
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> |
||
{{Module rating|release}} |
{{Module rating|release}} |
||
{{IfSandbox|| |
|||
{{Module rating|protected}} |
{{Module rating|protected}} |
||
}} |
|||
The main entrypoint is the <code>get</code> function. |
The main entrypoint is the <code>get</code> function. |
||
First parameter is the release type, which can be one of the following: |
First parameter is the release type, which can be one of the following: |
||
* <code>stable</code> |
* <code>stable</code> |
||
* <code>legacy</code> |
* <code>legacy</code> |
||
| Line 24: | Line 26: | ||
* <code>date</code> |
* <code>date</code> |
||
Note that <code>alpha</code> only |
Note that <code>alpha</code>{{int|and}}{{int|word-separator}}<code>beta</code> only work with <code>branch</code>, the behaviour of other output formats is undefined. |
||
== Examples == |
== Examples == |
||
* <code><nowiki>{{#invoke:Version|get|alpha|branch}}</nowiki></code>: {{#invoke:Version|get|alpha|branch}} |
* <code><nowiki>{{</nowiki>#invoke:Version{{\sandbox}}<nowiki>|get|alpha|branch}}</nowiki></code>: {{#invoke:Version{{\sandbox}}|get|alpha|branch}} |
||
* <code><nowiki>{{#invoke:Version|get|beta|branch}}</nowiki></code>: {{#invoke:Version|get|beta|branch}} |
* <code><nowiki>{{</nowiki>#invoke:Version{{\sandbox}}<nowiki>|get|beta|branch}}</nowiki></code>: {{#invoke:Version{{\sandbox}}|get|beta|branch}} |
||
* <code><nowiki>{{#invoke:Version|get|stable|version}}</nowiki></code>: {{#invoke:Version|get|stable|version}} |
* <code><nowiki>{{</nowiki>#invoke:Version{{\sandbox}}<nowiki>|get|stable|version}}</nowiki></code>: {{#invoke:Version{{\sandbox}}|get|stable|version}} |
||
* <code><nowiki>{{#invoke:Version|get|stable|branch}}</nowiki></code>: {{#invoke:Version|get|stable|branch}} |
* <code><nowiki>{{</nowiki>#invoke:Version{{\sandbox}}<nowiki>|get|stable|branch}}</nowiki></code>: {{#invoke:Version{{\sandbox}}|get|stable|branch}} |
||
* <code><nowiki>{{#invoke:Version|get|stable|git}}</nowiki></code>: {{#invoke:Version|get|stable|git}} |
* <code><nowiki>{{</nowiki>#invoke:Version{{\sandbox}}<nowiki>|get|stable|git}}</nowiki></code>: {{#invoke:Version{{\sandbox}}|get|stable|git}} |
||
* <code><nowiki>{{#invoke:Version|get|stable|date}}</nowiki></code>: {{#invoke:Version|get|stable|date}} |
* <code><nowiki>{{</nowiki>#invoke:Version{{\sandbox}}<nowiki>|get|stable|date}}</nowiki></code>: {{#invoke:Version{{\sandbox}}|get|stable|date}} |
||
* <code><nowiki>{{#invoke:Version|get|lts|version}}</nowiki></code>: {{#invoke:Version|get|lts|version}} |
* <code><nowiki>{{</nowiki>#invoke:Version{{\sandbox}}<nowiki>|get|lts|version}}</nowiki></code>: {{#invoke:Version{{\sandbox}}|get|lts|version}} |
||
* <code><nowiki>{{#invoke:Version|get|legacy|version}}</nowiki></code>: {{#invoke:Version|get|legacy|version}} |
* <code><nowiki>{{</nowiki>#invoke:Version{{\sandbox}}<nowiki>|get|legacy|version}}</nowiki></code>: {{#invoke:Version{{\sandbox}}|get|legacy|version}} |
||
* <code><nowiki>{{#invoke:Version|get|legacylts|version}}</nowiki></code>: {{#invoke:Version|get|legacylts|version}} |
* <code><nowiki>{{</nowiki>#invoke:Version{{\sandbox}}<nowiki>|get|legacylts|version}}</nowiki></code>: {{#invoke:Version{{\sandbox}}|get|legacylts|version}} |
||
That said, you probably want to use one of the wrapper templates in {{ll|Category:MediaWiki version information templates}} instead of calling this module directly.{{why}} |
That said, you probably want to use one of the wrapper templates in {{ll|Category:MediaWiki version information templates}} instead of calling this module directly.{{why}} |
||
Latest revision as of 23:54, 12 December 2025
| This is a documentation subpage for Module:Version/doc. It contains usage information, categories and other content that is not part of the original Module page. |
| This module is rated as ready for general use. It has reached a mature form and is thought to be bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other resources as an option for new users to learn. To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing. |
| This module is subject to page protection. It is a highly visible module in use by a very large number of pages. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
The main entrypoint is the get function.
First parameter is the release type, which can be one of the following:
stablelegacyltsbetaalpha
Second parameter is the format, which can be one of the following:
versionbranchgitdate
Note that alpha and beta only work with branch, the behaviour of other output formats is undefined.
Examples
{{#invoke:Version|get|alpha|branch}}: 1.47{{#invoke:Version|get|beta|branch}}: —{{#invoke:Version|get|stable|version}}: 1.46.0{{#invoke:Version|get|stable|branch}}: 1.46{{#invoke:Version|get|stable|git}}: REL1_46{{#invoke:Version|get|stable|date}}: 2026-06-30{{#invoke:Version|get|lts|version}}: 1.43.9{{#invoke:Version|get|legacy|version}}: 1.45.4{{#invoke:Version|get|legacylts|version}}: 1.43.9
That said, you probably want to use one of the wrapper templates in Category:MediaWiki version information templates instead of calling this module directly.[why?]