Nicht angemeldeter Benutzer - Bearbeiten von Seiten ist nur als angemeldeter Benutzer möglich.
Änderungen
Zur Navigation springen
Zur Suche springen
Zeile 1:
Zeile 1:
− +
Zeile 26:
Zeile 26:
+
+
Zeile 149:
Zeile 151:
−
−
−
− local function facility( about, asked )
− -- Create description head
− -- Parameter:
− -- about -- table, supposed to contain description
− -- asked -- true, if mandatory description
− -- Returns <block>, with head, or nil
− local para = mw.html.create( "p" )
− local plus, r
− if about and about.description then
− if type( about.description ) == "string" then
− para:wikitext( about.description )
− else
− para:wikitext( about.description[ 1 ] )
− plus = mw.html.create( "ul" )
− :addClass( "templatedata-maintain" )
− :css( "display", "none" )
− for k, v in pairs( about.description[ 2 ] ) do
− plus:node( mw.html.create( "li" )
− :node( mw.html.create( "code" )
− :wikitext( k ) )
− :node( "br" )
− :wikitext( fair( v ) ) )
− end -- for k, v
− end
− elseif Config.solo and asked then
− para:addClass( "error" )
− :wikitext( Config.solo )
− Data.less = true
− else
− para = false
− end
− if para then
− if plus then
− r = mw.html.create( "div" )
− :wikitext( para, plus )
− else
− r = para
− end
− end
− return r
− end -- facility()
Zeile 424:
Zeile 382:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Zeile 551:
Zeile 554:
− +
Zeile 911:
Zeile 914:
− +
+
+
+
+
+
+
+
+
+
+
Zeile 961:
Zeile 974:
− +
− if TemplateData.frame then+
− local div = mw.html.create( "div" )+
− local tdata = { [ 1 ] = "templatedata",+
− [ 2 ] = Data.slim }+
− Data.strip = TemplateData.frame:callParserFunction( "#tag",+
− tdata )+
− div:wikitext( Data.strip )+
− if Config.loudly then+
− Data.div:node( mw.html.create( "hr" ) )+
− else+
− div:css( "display", "none" )+
+
+
+
− Data.div:node( div )
Zeile 996:
Zeile 1.011:
+
+
Modul:TemplateData (Quelltext anzeigen)
Version vom 10. April 2017, 10:12 Uhr
, 10:12, 10. Apr. 20172017-04-10
local TemplateData = { serial = "2017-04-09",
local TemplateData = { serial = "2017-04-10",
suite = "TemplateData" }
suite = "TemplateData" }
--[=[
--[=[
less = false, -- main description missing
less = false, -- main description missing
lasting = false, -- old syntax encountered
lasting = false, -- old syntax encountered
lazy = false, -- doc mode; do not generate effective <templatedata>
leading = false, -- show TOC
-- low = false, -- 1= mode
-- low = false, -- 1= mode
order = false, -- parameter sequence
order = false, -- parameter sequence
return r
return r
end -- facet()
end -- facet()
end
end
end -- fathers()
end -- fathers()
local function feasible( about, asked )
-- Create description head
-- Parameter:
-- about -- table, supposed to contain description
-- asked -- true, if mandatory description
-- Returns <block>, with head, or nil
local para = mw.html.create( "p" )
local plus, r
if about and about.description then
if type( about.description ) == "string" then
para:wikitext( about.description )
else
para:wikitext( about.description[ 1 ] )
plus = mw.html.create( "ul" )
:addClass( "templatedata-maintain" )
:css( "display", "none" )
for k, v in pairs( about.description[ 2 ] ) do
plus:node( mw.html.create( "li" )
:node( mw.html.create( "code" )
:wikitext( k ) )
:node( "br" )
:wikitext( fair( v ) ) )
end -- for k, v
end
elseif Config.solo and asked then
para:addClass( "error" )
:wikitext( Config.solo )
Data.less = true
else
para = false
end
if para then
if plus then
r = mw.html.create( "div" )
:node( para )
:node( plus )
else
r = para
end
end
return r
end -- feasible()
-- description etc.
-- description etc.
s = facility( param )
s = feasible( param )
if s then
if s then
desc:node( s )
desc:node( s )
-- Returns <div>
-- Returns <div>
local r = mw.html.create( "div" )
local r = mw.html.create( "div" )
local s = facility( Data.tree, true )
local s = feasible( Data.tree, true )
if s then
if s then
r:node( s )
r:node( s )
end
if Data.leading then
r:newline()
:wikitext( "__TOC__" )
:newline()
end
end
s = features()
s = features()
if s then
if s then
if Data.leading then
r:node( mw.html.create( "h2" )
:wikitext( factory( "doc-params" ) ) )
:newline()
end
r:node( s )
r:node( s )
end
end
end
end
Data.div:node( format() )
Data.div:node( format() )
Data.slim = flush()
if not Data.lazy then
Data.slim = flush()
if TemplateData.frame then
local div = mw.html.create( "div" )
local tdata = { [ 1 ] = "templatedata",
[ 2 ] = Data.slim }
Data.strip = TemplateData.frame:callParserFunction( "#tag",
tdata )
div:wikitext( Data.strip )
if Config.loudly then
Data.div:node( mw.html.create( "hr" ) )
else
div:css( "display", "none" )
end
Data.div:node( div )
end
end
end
end
end -- full()
end -- full()
Config.loudly = true
Config.loudly = true
end
end
Data.lazy = faculty( arglist.lazy ) and not Config.loudly
Data.leading = faculty( arglist.TOC )
if arglist.JSON then
if arglist.JSON then
source = arglist.JSON
source = arglist.JSON