Module:Template introspection: Difference between revisions

Ganaram inukshuk (talk | contribs)
implement same fix as dochead module
Ganaram inukshuk (talk | contribs)
change output to display functions but link to modules
Line 59: Line 59:
if #invokes == 0 then
if #invokes == 0 then
hatnote = "This template does not invoke any functions."
hatnote = "This template does not invoke any functions."
return hatnote
return string.format(":''%s''\n", hatnote)
else
else
hatnote = "This template invokes the following functions from Lua modules:"
hatnote = "This template invokes the following functions:"
local calls = {}
local calls = {}
for _, call in ipairs(invokes) do
for _, call in ipairs(invokes) do
table.insert(calls, string.format("'''%s''' from [[Module:%s]]", call.func, call.module))
table.insert(calls, string.format("[[Module:%s | %s]]", call.module, call.func))
end
end
return string.format(":''%s'' %s\n", hatnote, table.concat(calls, ", "))
return string.format(":''%s %s''\n", hatnote, table.concat(calls, ", "))
end
end
end
end