Module:Hooks

From Guild of Archivists
Revision as of 09:53, 19 September 2012 by Alahmnat (talk | contribs) (as with JS stuff, some <nowiki> arround to not parse the text on page save)
(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>