Module:MakeInvokeFunc
Appearance
| This module depends on the following other modules: |
| Description | This module quickly and easily makes a function invokable in a module. |
|---|---|
| Status | Unknown |
| Updated | June 25, 2026 (32 days ago) |
| Dependencies | Module:Arguments |
This module quickly and easily makes a function invokable in a module. Based on work in Module:Documentation.
Documentation
Package function
MakeInvokeFunc( p )(function)- This module quickly and easily makes a function invokable in a module.
- Parameter:
pPackage (table) - Returns: Invokable function generator
Other items
Documentation above is auto generated
--- This module quickly and easily makes a function invokable in a module.
-- Based on work in [[Module:Documentation]].
--
-- @module MakeInvokeFunc
-- @require Module:Arguments
-- @type function
-- @param {table} p Package
-- @return Invokable function generator
return function(p)
--- Invokable function generator
--
-- @param {string} funcName Name of function
-- @return Entrypoint for the function
return function(funcName)
--- Entrypoint for invokable functions
--
-- @param {table} frame Invokable frame
-- @return Output wikitext for invoked function
return function (frame)
local args = require("Module:Arguments").getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
end