Module:Template

local template = {}

function template.example(frame) local result, args = '', frame.args[1] and frame.args or frame:getParent.args local subst, title = mw.ustring.match( args[1] or '', '^%s*(subst):(.+)$' ) -- get title whether pagename, subst:pagename, or safesubst:pagename if not subst then subst, title = mw.ustring.match( args[1] or '', '^%s*(safesubst):(.+)$' ) title = title or args[1] or '' end local success, page = pcall(function(title)       return mw.title.new( title, 'Template' )    end, title or '' ) if not success or not page then return result end result = '' return result end

return template