| Vorlagenprogrammierung | Diskussionen | Lua | Unterseiten | |||
| Modul | Deutsch | English
|
Modul: | Dokumentation | ||
PageAttributes – Module to assign attributes to pages or entire namespaces.
# and digits only following: numerical page ID1 for truefalse or nothing assigned oder unknown groupThe 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 | »2022-06-06« |
| 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
|
»2022-06-06« |
item
|
ID of the Wikidata item
|
Q112249306
|
~
|
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.
| ||
A group of properties may be defined via a sub-module.
mw.loadData but may be JSON in future.rooms – table
pageids – table
failsafe – string
The functions described above can be used by other modules per require() :
local lucky, PageAttributes = pcall( require, "Module:PageAttributes" )
if type( PageAttributes ) == "table" then
PageAttributes = PageAttributes()
else
-- failure; PageAttributes is the error message
return "<span class=\"error\">" .. PageAttributes .. "</span>"
end
Then there is available:
# and digits only following as page nummerfalse if nothing assignednil if unknown groupfalseNone.
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.