Modul:Vorlage:LuaModuleDoc: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Modul:Vorlage:LuaModuleDoc (bearbeiten)
Version vom 12. November 2016, 12:07 Uhr
, 12. November 20162016-11-11
K (1 Version) |
wp>PerfektesChaos (2016-11-11) |
||
Zeile 1: | Zeile 1: | ||
--[=[ | local Serial = "2016-11-11" | ||
--[=[ | |||
Support {{LuaModuleDoc}} | Support {{LuaModuleDoc}} | ||
* nav() | * nav() | ||
* failsafe() | |||
require: LuaWiki | require: LuaWiki | ||
]=] | ]=] | ||
Zeile 187: | Zeile 189: | ||
-- LuaWiki.getArg() | -- LuaWiki.getArg() | ||
-- LuaWiki.isExisting() | -- LuaWiki.isExisting() | ||
local super = false | local super = false | ||
local collect = navLangs( nsDocs, start, script ) | local collect = navLangs( nsDocs, start, script ) | ||
local t = navDevelop( nsDocs, start, script ) | local t = navDevelop( nsDocs, start, script ) | ||
local r | |||
local s | |||
if t then | if t then | ||
collect.Test = t | collect.Test = t | ||
Zeile 248: | Zeile 250: | ||
s = s:gsub( p1, "" ):gsub( p2, "" ) | s = s:gsub( p1, "" ):gsub( p2, "" ) | ||
if s:match( d ) then | if s:match( d ) then | ||
r = | r = string.format( "%s<br />%s<br />", | ||
r, | |||
navError( "BadInclude", | |||
t.prefixedText ) ) | |||
else | else | ||
r = r .. LuaWiki.transclude( t.prefixedText ) | r = r .. LuaWiki.transclude( t.prefixedText ) | ||
Zeile 272: | Zeile 275: | ||
i = mw.title.makeTitle( "Category", s ) | i = mw.title.makeTitle( "Category", s ) | ||
if i.exists then | if i.exists then | ||
r = | r = string.format( "%s[[%s|%s]]", | ||
r, i.prefixedText, collect[ 1 ] ) | |||
end | end | ||
end | end | ||
r = r .. "__NOEDITSECTION__" | r = r .. "__NOEDITSECTION__" | ||
end | |||
if lead then | |||
local entity = mw.wikibase.getEntity() | |||
if entity then | |||
s = LuaWiki.getArg( "categoryWikiData", "" ) | |||
if #s > 0 then | |||
i = mw.title.makeTitle( "Category", s ) | |||
if i.exists then | |||
r = string.format( "%s[[%s|%s]]", | |||
r, i.prefixedText, s ) | |||
end | |||
end | |||
end | |||
end | end | ||
return r | return r | ||
Zeile 380: | Zeile 396: | ||
end | end | ||
return r | return r | ||
end | |||
function p.failsafe() | |||
return Serial | |||
end | end | ||
return p | return p |