Module:Module introspection: Difference between revisions
ArrowHead294 (talk | contribs) m Use "wtext" instead of "debug" |
ArrowHead294 (talk | contribs) mNo edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 13: | 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 | 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 63: | 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 | 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 158: | Line 158: | ||
'{| class="wikitable mw-collapsible"', | '{| class="wikitable mw-collapsible"', | ||
'|-', | '|-', | ||
'! colspan="2" style="font-size: 105%;" | Introspection summary for Module: | '! 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 222: | Line 222: | ||
}) | }) | ||
-- 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 | ||