Help:Lua debugging: Difference between revisions

Content deleted Content added
Using personal sandbox for script development: coyedit english usage. "allos to VERB" is not native english syntax.
changed "User:Lua Developer/sandbox/Module/M" to "User:Lua Developer/sandbox/Module:M" (according to the example)
Line 33:
Let's take a practical example. for this example, assume your user name is "Lua Developer". Let's say you want to test a bug-fix or enhancement to the [[Module:String|String]] module. There are two reasons you can't do it directly: this module contains functions that are used by hundreds of templates, transcluded in millions of articles. Any bug will present a huge disruption to Wikipedia. The 2nd reason is more prosaic: because this module is so central, it is also protected, and our "Lua Developer" user does not have the required permissions to modify this module.
 
So, the first step in "sandboxing" is to copy [[Module:String]] to the private page [[User:Lua Developer/sandbox/Module:String]]. Now our developer can edit the module to her heart's content. At any given moment, she can open [[Special:TemplateSandbox]], using the default "Sandbox prefix", which in her case, will be "User:Lua Developer/sandbox". This means that viewing any page from the sandbox page, whenever the parser encounters a Template '''T''' or Module '''M''', it will look first to see if a page named "User:Lua Developer/sandbox/Template:T" or "User:Lua Developer/sandbox/Module/:M" exists, and if so, the parser will use those for the parsed page, instead of the ones in the "real" Module and Template namespaces. Any template or module which do not exist under the "Sandbox prefix", will be pulled by the parser from the appropriate namespace.
 
From the Template sandbox, the developer can view any page, and can also enter raw wikitext, and ask the parser to parse it using the faux templates and modules she created under the "Sandbox prefix"