Wikipedia:Lua/Modul/Vorlage:Phab/en
Vorlagenprogrammierung | Diskussionen | Lua | Test | Unterseiten | |||
Modul | Deutsch | English
|
Modul: | Dokumentation |
Vorlage:Phab
– Module for support of the Vorlage:Phab, and do their entire work: generate titled external link(s) to a ressource or generated page in software administration or source code repository of MediaWiki.
Functions for templates
[Quelltext bearbeiten]- f
- Parameters:
- All parameters are taken from template transclusion.
#invoke
is to be called without any parameter.
- Return: external link in [brackets].
- failsafe
The Failsafe interface is heading for version management of globally distributed Lua modules. It enables modules equipped with this interface to
- ensure, that a library module required by a template or another module available as local copy does support certain functionality, or complain if not.
- administrate global updating and linking of module codes via Wikidata.
The Failsafe interface is present both at template level and for direct Lua access.
The functions in detail are (not all supported yet completely by every library):
Value | Result | current |
---|---|---|
nothingfalse
|
local version ID | »2021-03-30« |
Minimal version | version ID required at least date in ISO format It will be compared whether the current local implementation matches this version or later.
|
|
wikidata
|
version ID of global upstream
|
»2021-03-30« |
item
|
ID of the Wikidata item
|
Q97313076
|
~
|
Corresponding version ID locally and registered at Wikidata
|
»« |
@
|
Is the current (module) page linked correctly with Wikidata item?
|
|
The return value is in template programming empty or under Lua false , otherwis a non-empty string as described.
|
Usage
[Quelltext bearbeiten]Nowhere than by Vorlage:Phab.
Parameters for template
[Quelltext bearbeiten]Abstract links to source code, bug tickets and other pages in MediaWiki software administration
Parameter | Description | Type | Status | |
---|---|---|---|---|
anchor | Anchor | fragment number of a task contribution (digits only) | Number | optional |
Bugzilla | Bugzilla | Bugzilla number, maybe with fragment number of comment | Line | optional |
media file | File | File number (with or without 'F') – *not* 'file=' | Line | optional |
mockup | Mock | Mock number (with or without 'M') | Line | optional |
link title | Show | displayed link title for tasks; and File, Mock etc. | Line | optional |
task (bug) | Task | Task number (with or without 'T'), maybe with number of a comment | Line | optional |
revision | branch | revision ID, like 'REL1_20' or intermediate (40 hex) | Line | optional |
commit | commit | survey about a commit (40 chars hexcode [low]) | Line | optional |
commit diff | commitdiff | diff by a commit (40 chars hexcode [low]) | Line | optional |
diff | diff | diff to current revision (HEAD); referenced revision like at branch= | Line | optional |
path | dir | path to a folder or directory | Line | optional |
path source | file | path to a single source code – *not* 'File=' | Line | optional |
history | history | revision history for file, directory, project (provide 'history=1') | Boolean | optional |
line number | line | line number in source code (digits only) | Number | optional |
path plain | plain | path to a single plain text; mostly ASCII notes like README | Line | optional |
repository | project | single source code project ('repository'). Default: mediawiki/core | Line | optional |
link title source | title | displayed link title for source code issues | Line | optional |
-reserved- 1 | Countdown | to be assigned later | Line | deprecated |
-reserved- 2 | Differential | to be assigned later | Line | deprecated |
-reserved- 3 | Gerrit | to be assigned later | Line | deprecated |
-reserved- 4 | Join | to be assigned later | Line | deprecated |
-reserved- 5 | Paste | to be assigned later | Line | deprecated |
-reserved- 6 | Review | to be assigned later | Line | deprecated |
Functions for Lua modules (API)
[Quelltext bearbeiten]- test(a)
- Interface to unit tests.
- a
table; simulated template parameter list
- a
- Return string with external link(s) in [brackets].
Dependencies
[Quelltext bearbeiten]None.