| Vorlagenprogrammierung | Diskussionen | Lua | Unterseiten | |||
| Modul | Deutsch | English | Modul: | Dokumentation | ||
PageUtil – Module with functions for entire wiki pages.
|
editmove / create / upload½, ¾, 1[[ page name ]]
#lst: [[ page name ]] mark#lstx: [[ page name ]] mark
| <nowiki />
=== Conclusion ===
<nowiki />
The Failsafe interface is heading for version management of globally distributed Lua modules. It enables modules equipped with this interface to
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 | »2025-01-01« |
| 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
|
»2025-01-01« |
item |
ID of the Wikidata item
|
Q89064539 |
~ |
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. | ||
Some functions described above can be used by other modules per require():
local lucky, PageUtil = pcall( require, "Module:PageUtil" )
if type( PageUtil ) == "table" then
PageUtil = PageUtil()
else
-- error case; PageUtil contains message
return "<span class=\"error\">" .. PageUtil .. "</span>"
end
Subsequently there are available:
nilDirectly available are:
mw.title.getCurrentTitle().categories
mw.title.getCurrentTitle().contentModel
mw.title.getCurrentTitle().isRedirect
General library; no limitations.
None.