Module:Sandbox/2

local p = {} function p.canTalk(frame) local title = mw.title.getCurrentTitle return ';canTalk\n:' .. tostring(title.canTalk) .. '\n' end function p.baseText(frame) local title = mw.title.getCurrentTitle return ';baseText\n:' .. tostring(title.baseText) .. '\n' end function p.exists(frame) local title = mw.title.getCurrentTitle return ';exists\n:' .. tostring(title.exists) .. '\n' end function p.fileExists(frame) local title = mw.title.getCurrentTitle return ';fileExists\n:' .. tostring(title.fileExists) .. '\n' end function p.fragment(frame) local title = mw.title.getCurrentTitle return ';fragment\n:' .. title.fragment .. '\n' end function p.fullText(frame) local title = mw.title.getCurrentTitle return ';fullText\n:' .. title.fullText .. '\n' end function p.getContent(frame) local text = mw.text.trim(frame.args[1]) local namespace = mw.text.trim(frame.args[2]) local title = mw.title.new(text, namespace) return ';getContent\n"' .. title:getContent .. '"\n' end function p.id(frame) local title = mw.title.getCurrentTitle; return ';id\n:' .. title.id .. '\n' end function p.inNamespace(frame) local title = mw.title.getCurrentTitle; return ';inNamespace\n:' .. tostring(title:inNamespace(0)) .. '\n' end function p.inNamespaces(frame) local title = mw.title.getCurrentTitle; return ';inNamespaces\n:' .. tostring(title:inNamespaces(0)) .. '\n' end function p.interwiki(frame) local title = mw.title.getCurrentTitle; return ';interwiki\n:' .. title.interwiki .. '\n' end function p.isContentPage(frame) local title = mw.title.getCurrentTitle; return ';isContentPage\n:' .. tostring(title.isContentPage) .. '\n' end function p.isExternal(frame) local title = mw.title.getCurrentTitle; return ';isExternal\n:' .. tostring(title.isExternal) .. '\n' end function p.isLocal(frame) local title = mw.title.getCurrentTitle; return ';isLocal\n:' .. tostring(title.isLocal) .. '\n' end function p.isRedirect(frame) local title = mw.title.getCurrentTitle; return ';isRedirect\n:' .. tostring(title.isRedirect) .. '\n' end function p.isSpecialPage(frame) local title = mw.title.getCurrentTitle; return ';isSpecialPage\n:' .. tostring(title.isSpecialPage) .. '\n' end function p.isSubpage(frame) local title = mw.title.getCurrentTitle; return ';isSubpage\n:' .. tostring(title.isSubpage) .. '\n' end function p.isTalkPage(frame) local title = mw.title.getCurrentTitle; return ';isTalkPage\n:' .. tostring(title.isTalkPage) .. '\n' end function p.isSubpageOf(frame) local title = mw.title.getCurrentTitle; local text = mw.text.trim(frame.args[1]) local namespace = mw.text.trim(frame.args[2]) local title2 = mw.title.new(text, namespace) return ';isSubpageOf\n:' .. tostring(title:isSubpageOf(title2)) .. '\n' end function p.new(frame) local text = mw.text.trim(frame.args[1]) local namespace = mw.text.trim(frame.args[2]) local title = mw.title.new(text, namespace) return ';new\n:' .. title.id .. '\n' end function p.nsText(frame) local title = mw.title.getCurrentTitle; return ';nsText\n:' .. title.nsText .. '\n' end function p.prefixedText(frame) local title = mw.title.getCurrentTitle return ';prefixedText\n:' .. title.prefixedText .. '\n' end function p.rootText(frame) local title = mw.title.getCurrentTitle return ';rootText\n:' .. title.rootText .. '\n' end function p.subjectNsText(frame) local title = mw.title.getCurrentTitle return ';subjectNsText\n:' .. title.subjectNsText .. '\n' end function p.subpageText(frame) local title = mw.title.getCurrentTitle return ';subpageText\n:' .. title.subpageText .. '\n' end function p.text(frame) local title = mw.title.getCurrentTitle return ';text\n:' .. title.text .. '\n' end return p