Modül:Format TemplateData
local TemplateData = { suite = "TemplateData", serial = "2022-03-10", item = 46997995 }
--[==[
improve template:TemplateData
]==]
local Failsafe = TemplateData
local Config = { -- multiple option names mapped into unique internal fields basicCnf = { catProblem = "strange", classMultiColumns = "selMultClm", classNoNumTOC = "suppressTOCnum", classTable = "classTable", cssParWrap = "cssTabWrap", cssParams = "cssTable", docpageCreate = "suffix", docpageDetect = "subpage", helpBoolean = "support4boolean", helpContent = "support4content", helpDate = "support4date", helpFile = "support4wiki-file-name", helpFormat = "supportFormat", helpLine = "support4line", helpNumber = "support4number", helpPage = "support4wiki-page-name", helpString = "support4string", helpTemplate = "support4wiki-template-name", helpURL = "support4url", helpUser = "support4wiki-user-name", msgDescMiss = "solo", tStylesTOCnum = "stylesTOCnum", tStylesMultiColumns = "stylesMultClm" }, classTable = { "wikitable" }, -- classes for params table debugmultilang = "C0C0C0", loudly = false, -- show exported element, etc. solo = false, -- complaint on missing description strange = false, -- title of maintenance category cssTable = false, -- styles for params table cssTabWrap = false, -- styles for params table wrapper debug = false, subpage = false, -- pattern to identify subpage suffix = false, -- subpage creation scheme suppressTOCnum = false, -- class for TOC number suppression jsonDebug = "json-code-lint" -- class for jsonDebug tool
}
local Data = { div = false, -- got = false, -- table, initial templatedata object heirs = false, -- table, params that are inherited jump = false, -- source position at end of "params" less = false, -- main description missing lasting = false, -- old syntax encountered lazy = false, -- doc mode; do not generate effective leading = false, -- show TOC
-- low = false, -- 1= mode order = false, -- parameter sequence params = false, -- table, exported parameters scream = false, -- error messages sibling = false, -- TOC juxtaposed slang = nil, -- project/user language code slim = false, -- JSON reduced to plain source = false, -- JSON input strip = false, -- evaluation tag = false, -- table, exported root element title = false, -- page tree = false -- table, rewritten templatedata object
}
local Permit = { builder = { after = "block", align = "block", block = "block", compressed = "block", dense = "block", grouped = "inline", half = "inline", indent = "block", inline = "inline", last = "block", lead = "block", newlines = "*", spaced = "inline" }, colors = { tableheadbg = "B3B7FF", required = "EAF3FF", suggested = "FFFFFF", optional = "EAECF0", deprecated = "FFCBCB" }, params = { aliases = "table", autovalue = "string", default = "string table I18N nowiki", deprecated = "boolean string I18N", description = "string table I18N", example = "string table I18N nowiki", label = "string table I18N", inherits = "string", required = "boolean", style = "string table", suggested = "boolean", suggestedvalues = "string table number boolean", type = "string" }, root = { description = "string table I18N", format = "string", maps = "table", params = "table", paramOrder = "table", sets = "table" }, search = "[{,]%%s*(['\"])%s%%1%%s*:%%s*%%{", types = { boolean = true, content = true, date = true, line = true, number = true, string = true, unknown = true, url = true, ["wiki-file-name"] = true, ["wiki-page-name"] = true, ["wiki-template-name"] = true, ["wiki-user-name"] = true, ["unbalanced-wikitext"] = true, ["string/line"] = "line", ["string/wiki-page-name"] = "wiki-page-name", ["string/wiki-user-name"] = "wiki-user-name" }
}
local function Fault( alert ) -- Memorize error message -- Parameter: -- alert -- string, error message if Data. scream then Data.