Module:Module introspection: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 2: Line 2:
local getArgs = require("Module:Arguments").getArgs
local getArgs = require("Module:Arguments").getArgs
local iutils  = require("Module:Introspection utils")
local iutils  = require("Module:Introspection utils")
local yesno  = require("Module:Yesno")


local p = {}
local p = {}
Line 12: Line 13:
local lines = {}
local lines = {}
table.insert(lines, '{| class="wikitable sortable"')
table.insert(lines, '{| class="wikitable sortable"')
table.insert(lines, "|+ style=\"font-size: 105%;\" | Lua modules required " .. string.format("(%d)", #module_deps))
table.insert(lines, "|+ style=\"font-size: 105%;\" | " .. string.format("Lua modules required (%d)", #module_deps))
table.insert(lines, "|-")
table.insert(lines, "|-")
table.insert(lines, "! Variable")
table.insert(lines, "! Variable")
Line 62: Line 63:
--table.insert(lines, string.format("'''Module:%s''' provides %d function(s):", module_name, #module_funcs))
--table.insert(lines, string.format("'''Module:%s''' provides %d function(s):", module_name, #module_funcs))
table.insert(lines, '{| class="wikitable sortable"')
table.insert(lines, '{| class="wikitable sortable"')
table.insert(lines, "|+ style=\"font-size: 105%;\" | Functions provided " .. string.format("(%d)", #module_funcs))
table.insert(lines, "|+ style=\"font-size: 105%;\" | " .. string.format("Functions provided (%d)", #module_funcs))
table.insert(lines, "|-")
table.insert(lines, "|-")
table.insert(lines, "! Line")
table.insert(lines, "! Line")
Line 157: Line 158:
'{| class="wikitable mw-collapsible"',
'{| class="wikitable mw-collapsible"',
'|-',
'|-',
'! colspan="2" | Introspection summary for Module:' .. module_name .. " ",
'! colspan="2" style="font-size: 105%;" | ' .. string.format("Introspection summary for Module:%s ", module_name),
"|-",
"|-",
'| style="vertical-align: top; border-right: none;"; |',
'| style="vertical-align: top; border-right: none;" | ',
func_table,
func_table,
'| style="vertical-align: top; border-left: none;" |',
'| style="vertical-align: top; border-left: none;" | ',
dep_table,
dep_table,
"|}"
"|}"
Line 221: Line 222:
})
})


if yesno(frame.args["debug"]) == true then
    -- Debugger option to show generated WikiText
    local wtext = yesno(frame.args["wtext"] or args["wtext"])
 
if wtext == true then
result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>"
result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>"
end
end