Module:shortcut box
Jump to navigation
Jump to search
Documentation for this module may be created at Module:shortcut box/documentation
local export = {}
local m_message_box = require("Module:Message box")
local m_template = require("Module:template")
function export.format_shortcuts(shortcuts)
local text = {}
for _, shortcut in ipairs(shortcuts) do
if string.sub(shortcut, 9) == "Template:" then
table.insert(text, m_template.make_template({string.sub(shortcut, 10)}, false))
else
table.insert(shortcut)
end
end
return table.concat(text, "\n")
end
function export.render_box(shortcuts)
local formatted_shortcuts = export.format_shortcuts(shortcuts)
return m_message_box.main("mbox", {
text = "'''Shortcuts'''\n----\n" .. formatted_shortcuts,
type = "notice",
small = true,
style = "text-align:center;",
})
end
function export.show(frame)
return export.render_box(frame:getParent().args)
end
return export