Module:WelcomeTool

-- Module:WelcomeTool --    Enhancements for Help:Welcome tool --    e.g. Low maintenance welcome messages.

local wrap_func = require("Module:Utils").make_wrapper_function local links = require('Module:Links')

local function page_link(page_name) local page = mw.title.new(page_name) if page.exists then return links.wikilink(page, page_name) else return page_name end end

return { -- Wikilinks formatted for text only (e.g. Thread:101|Help -> Help) -- Useful for this wiki since deletions and moves are commonplace link_to_text = function(frame) local args = frame.args if (not args[2]) then args = mw.text.split(args[1], '|') end return frame:preprocess(           "[ " .. (args[2] or args[1]) .. "]") end, unformatted_page_link = wrap_func(function(args)       return page_link(args[1])    end), page_link = wrap_func(function(args)       return "" .. page_link(args[1]) .. ""    end) }