Bearbeiten von „Modul:Vorlage:Dokumentation“
Zur Navigation springen
Zur Suche springen
Die Bearbeitung kann rückgängig gemacht werden. Bitte prüfe den Vergleich unten, um sicherzustellen, dass du dies tun möchtest, und veröffentliche dann unten deine Änderungen, um die Bearbeitung rückgängig zu machen.
Aktuelle Version | Dein Text | ||
Zeile 1: | Zeile 1: | ||
--[=[ | --[=[ 2018-04-24 | ||
{{Dokumentation}} | {{Dokumentation}} | ||
]=] | ]=] | ||
Zeile 73: | Zeile 69: | ||
local function furnish( area | local function furnish( area ) | ||
local i = area:find( "==", 1, true ) | local i = area:find( "==", 1, true ) | ||
local r | local r | ||
Zeile 100: | Zeile 96: | ||
r = "__NOTOC__\n" .. area | r = "__NOTOC__\n" .. area | ||
elseif n == 2 then | elseif n == 2 then | ||
local toc = mw.html.create( "div" ) | |||
local toc | :newline() | ||
:addClass( "nonumtoc" ) | |||
:wikitext( "__TOC__" ) | |||
:newline() | |||
toc = tostring( toc ) | |||
toc = | |||
if init == 1 then | if init == 1 then | ||
r = toc .. area | r = toc .. area | ||
Zeile 127: | Zeile 119: | ||
local function f( frame ) | local function f( frame ) | ||
local bottom = { } | local bottom = { } | ||
local doku = mw.title.makeTitle( | local current = mw.title.getCurrentTitle() | ||
local doku = mw.title.makeTitle( current.namespace, | |||
local sub = | current.text .. "/Doku" ) | ||
local sub = current.prefixedText .. "/Doku" | |||
local r | local r | ||
if doku.exists then | if doku.exists then | ||
Zeile 135: | Zeile 128: | ||
if not findeSchalter( r ) then | if not findeSchalter( r ) then | ||
if not findeTemplateDataTOC( r ) then | if not findeTemplateDataTOC( r ) then | ||
r = furnish( r | r = furnish( r ) | ||
end | end | ||
end | end | ||
Zeile 154: | Zeile 147: | ||
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 162: | Zeile 155: | ||
r = r .. frame:expandTemplate{ title = "Dokumentation/footer", | r = r .. frame:expandTemplate{ title = "Dokumentation/footer", | ||
args = bottom } | args = bottom } | ||
if current.namespace == 10 then | |||
local cats | |||
sub = current.text .. "/Meta" | |||
cats = mw.title.makeTitle( 10, sub ) | |||
if cats.exists then | |||
local s = string.format( "[[%s|/Meta]]", | |||
cats.prefixedText ) | |||
local wl = mw.html.create( "code" ) | |||
:wikitext( s ) | |||
local e = mw.html.create( "div" ) | |||
:addClass( "error" ) | |||
:css( { background = "#FFFF00", | |||
border = "#FF0000 2px solid", | |||
margin = "1em", | |||
padding = "5px" } ) | |||
r = r .. tostring( e:wikitext( "Unterseite " ) | |||
:node( wl ) | |||
:wikitext( " nicht mehr unterstützt" ) ) | |||
.. fatal() | |||
end | |||
end | |||
return r | return r | ||
end -- f() | end -- f() | ||
Zeile 168: | Zeile 182: | ||
local p = {} | local p = {} | ||
function p.f( frame ) | function p.f( frame ) |