Module:Page: Difference between revisions

Content deleted Content added
Get rid of repeated code, use Lua errors without ___location information for error handling
Remove out-of-date content fork of /doc
Tags: Mobile edit Mobile web edit
Line 1:
---- This module is meant to allow the goodies listed in
---- http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Title_objects
---- to be accessed by people who don't want to program a Lua module.
---- Usage is: {{#invoke:Page|(function)|parameters}}
---- (function) is one of the function names from the table above:
---- id, interwiki, namespace, fragment, nsText, subjectNsText, text, prefixedText, fullText ...
 
---- parameters are:
---- page = (name of page to load; leave blank to call mw.title.getCurrentTitle()
---- this is "text" passed to mw.title.new or "title" passed to mw.title.makeTitle
---- makeTitle = nonblank to call mw.title.makeTitle otherwise mw.title.new is called
---- namespace = (parameter passed to new/makeTitle)
---- fragment = (parameter passed to makeTitle)
---- interwiki = (parameter passed to makeTitle)
---- p1 = first parameter passed to functions within the title object
---- p2 = second parameter " " " "
---- p3 etc. (for inNamespaces)
 
local function callAssert(func, funcName, ...)
local result = { func(...) }