Modul:TemplateData: Unterschied zwischen den Versionen
2017-11-05
wp>PerfektesChaos (2017-10-15) |
wp>PerfektesChaos (2017-11-05) |
||
Zeile 1: | Zeile 1: | ||
local TemplateData = { serial = "2017- | local TemplateData = { serial = "2017-11-05", | ||
suite = "TemplateData" } | suite = "TemplateData" } | ||
--[=[ | --[=[ | ||
Zeile 9: | Zeile 9: | ||
local Config = { | local Config = { | ||
-- multiple #invoke option names mapped into unique internal fields | -- multiple #invoke option names mapped into unique internal fields | ||
cat | cat = "strange", | ||
-- classParams | classNoNumTOC = "suppressTOCnum", | ||
cssParams | -- classParams = "classTable", | ||
cssParWrap | cssParams = "stylesTable", | ||
debug | cssParWrap = "stylesTabWrap", | ||
docpageCreate = "suffix", | debug = false, | ||
docpageDetect = "subpage", | docpageCreate = "suffix", | ||
msgDescMiss | docpageDetect = "subpage", | ||
-- classTable | msgDescMiss = "solo", | ||
loudly | -- classTable = false, -- class for params table | ||
solo | loudly = false, -- show exported element, etc. | ||
strange | solo = false, -- complaint on missing description | ||
stylesTable | strange = false, -- title of maintenance category | ||
stylesTabWrap = false, -- styles for params table wrapper | stylesTable = false, -- styles for params table | ||
subpage | stylesTabWrap = false, -- styles for params table wrapper | ||
suffix | subpage = false, -- pattern to identify subpage | ||
suffix = false, -- subpage creation scheme | |||
suppressTOCnum = false -- class for TOC number suppression | |||
} | } | ||
local Data = { | local Data = { | ||
Zeile 971: | Zeile 973: | ||
end | end | ||
if Data.leading then | if Data.leading then | ||
local toc = mw.html.create( "div" ) | |||
if Config.suppressTOCnum then | |||
toc:addClass( Config.suppressTOCnum ) | |||
end | |||
toc:wikitext( "__TOC__" ) | |||
r:newline() | r:newline() | ||
: | :node( toc ) | ||
:newline() | :newline() | ||
end | end | ||
Zeile 979: | Zeile 986: | ||
if Data.leading then | if Data.leading then | ||
r:node( mw.html.create( "h2" ) | r:node( mw.html.create( "h2" ) | ||
:wikitext( factory( "doc-params" ) ) ) | |||
:newline() | :newline() | ||
end | end |