Extension:TemplateSandbox

From mediawiki.org
This page is a translated version of the page Extension:TemplateSandbox and the translation is 35% complete.
これは、拡張機能の技術的な文書です。 ユーザードキュメントもあります。
MediaWiki 拡張機能マニュアル
TemplateSandbox
リリースの状態: 安定
実装 特別ページ , ページの操作
説明 サンドボックス化されたTemplateを使ってページをプレビューする
作者 Brad Jorsch (Anomieトーク)
最新バージョン 1.1.0 (continuous updates)
互換性の方針 MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。
MediaWiki 1.35+
PHP 7.0+
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
ヘルプ Help:Extension:TemplateSandbox/ja
  • $wgTemplateSandboxEditNamespaces
Quarterly downloads 53 (Ranked 96th)
Public wikis using 1,040 (Ranked 233rd)
translatewiki.net で翻訳を利用できる場合は、TemplateSandbox 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

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.

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のTemplateSandboxという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateSandbox
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'TemplateSandbox' );
    
  • Yes 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。


設定

パラメーター
  • $wgTemplateSandboxEditNamespaces - Namespaces in which to show the "Preview page with this template" box below the edit form. NS_TEMPLATE by default. Can be expanded to all namespaces by individual users using advancedtemplatesandbox.js.

使用法

The extension adds a new special page, 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 Template:Foo to User:Example/sandbox/Template:Foo. Alternatively, you might create User:Example/sandbox/Template:Foo as a redirect to Template:Foo/sandbox.
  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. User:Example/sandbox1|User:Example/sandbox2.
  3. Click View.

The extension also adds a box at the bottom of the edit form for pages in the namespaces configured in $wgTemplateSandboxEditNamespaces. 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 wpTemplateSandboxShow to the URL.

関連項目