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: | ||
--[=[ | --[=[ 2017-11-02 | ||
{{Dokumentation}} | {{Dokumentation}} | ||
]=] | ]=] | ||
Zeile 23: | Zeile 19: | ||
return tostring( e ) | return tostring( e ) | ||
end -- fake() | end -- fake() | ||
Zeile 73: | Zeile 59: | ||
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 86: | ||
r = "__NOTOC__\n" .. area | r = "__NOTOC__\n" .. area | ||
elseif n == 2 then | elseif n == 2 then | ||
if init == 1 then | if init == 1 then | ||
r = | r = "__TOC__\n" .. area | ||
else | else | ||
r = string.format( "% | r = string.format( "%s__TOC__\n%s", | ||
area:sub( 1, init - 1 ), | area:sub( 1, init - 1 ), | ||
area:sub( init ) ) | area:sub( init ) ) | ||
end | end | ||
Zeile 127: | Zeile 102: | ||
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 111: | ||
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 130: | ||
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]]", | ||
"Vorlage:nicht dokumentiert" ) | "Vorlage:nicht dokumentiert" ) | ||
end | end | ||
Zeile 168: | Zeile 143: | ||
local p = {} | local p = {} | ||
function p.f( frame ) | function p.f( frame ) | ||
Zeile 206: | Zeile 150: | ||
:attr( "class", "error" ) | :attr( "class", "error" ) | ||
:wikitext( r ) | :wikitext( r ) | ||
r = tostring( e ) | r = string.format( "%s[[Kategorie:%s/%s]]", | ||
tostring( e ), | |||
"Wikipedia:Vorlagenfehler", | |||
"Vorlage:Dokumentation/Intern" ) | |||
end | end | ||
return r | return r |