Module:Template introspection: Difference between revisions
implement same fix as dochead module |
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 | 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(" | table.insert(calls, string.format("[[Module:%s | %s]]", call.module, call.func)) | ||
end | end | ||
return string.format(":''%s'' | return string.format(":''%s %s''\n", hatnote, table.concat(calls, ", ")) | ||
end | end | ||
end | end | ||