Module:Documentation: Difference between revisions
Content deleted Content added
make a couple of the helper functions available for testing |
make all the helper functions available in the p table |
||
Line 16:
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
Line 45 ⟶ 48:
end
p.message = message
local function makeWikilink(page, display)
Line 54 ⟶ 57:
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. '
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return mw.ustring.format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
Line 76 ⟶ 85:
end
p.makeToolbar = makeToolbar
local function err(msg)
Line 85 ⟶ 94:
)
end
p.err = err
----------------------------------------------------------------------------
|