Modul:Vorlage:Dokumentation: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
2019-05-16
(2018-09-10) |
(2019-05-16) |
||
Zeile 1: | Zeile 1: | ||
--[=[ | --[=[ 2019-05-16 | ||
{{Dokumentation}} | {{Dokumentation}} | ||
]=] | ]=] | ||
local Current = mw.title.getCurrentTitle() | |||
Zeile 123: | Zeile 127: | ||
local function f( frame ) | local function f( frame ) | ||
local bottom = { } | local bottom = { } | ||
local doku = mw.title.makeTitle( Current.namespace, | |||
local doku = mw.title.makeTitle( | Current.text .. "/Doku" ) | ||
local sub = Current.prefixedText .. "/Doku" | |||
local sub = | |||
local r | local r | ||
if doku.exists then | if doku.exists then | ||
Zeile 151: | Zeile 154: | ||
if mw.site.server:match( "%.beta%.wmflabs%.org$" ) then | if mw.site.server:match( "%.beta%.wmflabs%.org$" ) then | ||
r = r .. fake( frame, sub ) | r = r .. fake( frame, sub ) | ||
elseif | elseif Current.namespace == 10 then | ||
r = string.format( "%s[[Kategorie:%s]]", | r = string.format( "%s[[Kategorie:%s]]", | ||
r, | r, | ||
Zeile 159: | Zeile 162: | ||
r = r .. frame:expandTemplate{ title = "Dokumentation/footer", | r = r .. frame:expandTemplate{ title = "Dokumentation/footer", | ||
args = bottom } | args = bottom } | ||
return r | return r | ||
end -- f() | end -- f() | ||
Zeile 186: | Zeile 168: | ||
local p = {} | local p = {} | ||
function p.hastemplate( frame ) | |||
r = Current.text:gsub( "/Doku$", "" ) | |||
:gsub( " ", "_" ) | |||
:gsub( "\"", """ ) | |||
if Current.namespace ~= 10 then | |||
r = string.format( "%s:%s", | |||
mw.site.namespaces[ Current.namespace ].name, | |||
r ) | |||
end | |||
return string.format( "hastemplate:%s+", r ) | |||
end -- p.hastemplate() | |||
function p.f( frame ) | function p.f( frame ) |