Module:Hooks

From Guild of Archivists
Revision as of 07:26, 30 October 2015 by Alahmnat (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Hooks/doc

-- This is a way to include a bunch of hooks on an extension page.
-- Pass in a comma-separated list of hooks you use.
-- <nowiki>

local explode = require('Explode').explode

return {
    make_hook_list = function (hookstr)
        local hooklist = explode(',', hookstr)
        local retval = ''
        for _, hook in ipairs(hooklist) do
            retval = retval .. '{{Extension/HookInUse|' .. hook .. '}}'
        end
        return retval
    end
}

-- </nowiki>