Extension:TemplateSandbox/zh


 * 这是这个-{zh-hans:扩展; zh-hant:擴充功能;}-的技术-{zh-hans:文档; zh-hant:文件;}-. There is also a user documentation. 

The TemplateSandbox extension adds the ability to preview a page using sandboxed versions of templates, allowing for easy testing before making the sandbox code live. It also works with Scribunto modules.

-{zh-hans:配置; zh-hant:組態;}-

 * 參數:


 * - Namespaces in which to show the "Preview page with this template" box below the edit form. -{zh-hans:默认; zh-hant:預設;}-為 . Can be expanded to all namespaces by individual users using advancedtemplatesandbox.js.

用法
此扩展会添加一个新的特殊页面：Special:TemplateSandbox To preview a page using sandboxed templates, do the following:


 * 1) Copy the templates to be tested under a common prefix. For example, you might copy   to  . Alternatively, you might create   as a redirect to.
 * 2) Go to Special:TemplateSandbox. Fill in the page or revision to be rendered, and the prefix you chose in step 1. It is possible to specify multiple prefixes (a prefix search path) by separating them using vertical bars, e.g..
 * 3) 点击查看.

The extension also adds a box at the bottom of the edit form for pages in the namespaces configured in. This allows for previewing some other page as it would appear were the template being edited saved with the current contents of the edit form. The box can be forced to appear in the edit form for any page by adding the query parameter  to the URL.

參見

 * User:Jackmcbarn/advancedtemplatesandbox.js — A MediaWiki user script that enables use of TemplateSandbox for all pages.
 * − This extension also allows for sandboxing Scribunto modules.
 * − This extension also allows for sandboxing Scribunto modules.
 * − This extension also allows for sandboxing Scribunto modules.