| Vorlagenprogrammierung | Diskussionen | Lua | Test | Unterseiten | |||
| Modul | Deutsch | English | Modul: | Dokumentation | |||
TemplUtl – Library module with functions to support template programming.
% – URL decoding0, false, n, no, off, 0000, - plus local language: German nein1, true, y, yes, on; 0101 (boolean OR concatenation) plus local language: German ja, j1 – “yes” (default)0 – “no”1) for “yes”0 – “invisible” (default)1 – “visible”% – URL decoding1 – Link each entry; as bulleted list*#;: or table begin or termination then precede a newline"&'<=>[]{|}*#;: then return it as an HTML entity.//:, ISBN , PMID , RFC *#;: then return it as an HTML entitylt – less thanle – less or equaleq – equalge – greater or equalgt – greater than1), otherwise “empty”.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 | »2026-09-09« |
| 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
|
»2026-09-09« |
item |
ID of the Wikidata item
|
Q52364930 |
~ |
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 test page illustrates practical use.
All functions described above can be used by other modules:
local lucky, TemplUtl = pcall( require, "Module:TemplUtl" )
if type( TemplUtl ) == "table" then
TemplUtl = TemplUtl()
else
-- error case; TemplUtl contains error message
return "<span class=\"error\">" .. TemplUtl .. "</span>"
end
Subsequently there are available:
% for URL decodingtrue, if “yes”, else false0 are “yes”.% for URL decodingtrue, if URL beginning (even protocol relative).| oder }}.
false
[ [[ {{ {{{ or falsetrue, if only to search for }}{{ is provided for ahead.| or }} – may be at end of area.true, if search to be continued at number.nilnil.1:)
"" for article (main spave)false for template{{ in area, or false.nowiki pre syntaxhighlight).
wikidata or ~ for synchronisationfalseGeneral library; no limitations.
No modules.
Follow the steps:
Module:TemplUtl into your project.
TemplUtl.