Module:Puppet

From Wikitech-static
Revision as of 22:02, 6 December 2018 by imported>BryanDavis (Remove back compat module alias)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Puppet/doc (Test casesTest results)

return {
    manifest = function (frame)
    	-- turn a Puppet manifest name like "::foo::bar::baz" into a link to the source
        local name = frame.args[1]
        local parts = mw.text.split(mw.text.trim(name, ":"), '::', true)
        if #parts == 1 then
        	parts[2] = 'init'
        end
        table.insert( parts, 2, "manifests" )
        return "<code>[[phab:source/operations-puppet/browse/production/modules/" ..
        	table.concat(parts, "/") .. ".pp|" .. name .. "]]</code>"
    end
}