Extension:MassEditRegex
この拡張機能は、MediaWiki 1.45 以降のあらゆるバージョンのリリースと互換性がありません。
|
リリースの状態: 安定 |
|
|---|---|
| 実装 | ページの操作, 特別ページ |
| 説明 | 正規表現を使用して複数のページを一度に編集できるようにする。 |
| 作者 | Adam Nielsen (Malvineousトーク) |
| 最新バージョン | 8.4.1 |
| MediaWiki | >= 1.40.0 |
| データベースの変更 | いいえ |
|
|
|
|
| ライセンス | GNU 一般公衆利用許諾書 2.0 以降 |
| ダウンロード | |
| translatewiki.net で翻訳を利用できる場合は、MassEditRegex 拡張機能の翻訳にご協力ください | |
| 問題点 | 未解決のタスク · バグを報告 |
MassEditRegex 拡張機能は、管理者が正規表現を使用して、複数のページのコンテンツに対して一括編集を行えるようにします。 これは、テンプレートの名前変更、カテゴリへのページ追加、または誤字の修正など、簡単な編集に適しています (これらすべては複数の正規表現を指定することで、同じ編集操作で実行できます)。
使用法
拡張機能をインストールし、MassEditRegex を使用するための masseditregex の権限が付与されたら、「Special:MassEditRegex」に移動し、編集フォームに記入してください。
この拡張機能を使用するには、正規表現の知識が必要です。
特徴
- ページの繰り返し処理はクライアント側で行うことができるため、多数のページを編集する際の PHP の最大実行時間の問題はなくなります。
- 1 つ以上の正規表現を使用して、単一のステップで各ページを変換します。
- 編集は「ボット」として表示されるため、通常の編集一覧には表示されません (利用者がボット編集を表示する設定にしない限り)。
masseditregexの権限を持つ利用者のみが変更を行えます。- 新しい「すべて編集」タブがカテゴリ ページや Special:WhatLinksHere に表示され、すべての列挙されたページを一度に編集できます。
- 編集するページは次のように指定できます:
- ページ名のリスト
- ページ名の接頭辞のリスト(例えば、「Test」は「Testing」や「Tested」というページに一致します)
- カテゴリのリスト(カテゴリ内のすべてのページが編集されます)
- 被リンクのリスト(リスト内のページにリンクしているページが編集対象になります)
インストール
- ダウンロードして、ファイルを
extensions/フォルダー内のMassEditRegexという名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MassEditRegex
- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
wfLoadExtension( 'MassEditRegex' );
- 利用者グループと利用者権限を必要に応じて設定します。
完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
設定
この拡張機能には、「masseditregex」という利用者権限が追加されており、どの利用者グループがこの拡張機能を使用できるかを細かく制御できます。
既定では、どの利用者グループにも割り当てられていません。
「masseditregexeditor」のような利用者グループに割り当てたい場合は、インストール手順(3)で「LocalSettings.php」ファイルに追加した行の直後に以下のコードを追加してください:
$wgGroupPermissions['masseditregexeditor']['masseditregex'] = true;
あるいは、次の行を追加して、「sysop」などの既存の利用者グループに権限を付与することもできます:
$wgGroupPermissions['sysop']['masseditregex'] = true;
Tips
Adding content to the top of the page:
- Detect any first character at the beginning of a page: → Search for:
/^(.)/ - Prepend my content to the char found at the beginning of a page, including a line break: → Replace with:
MyContent\n$1
既知の問題点
- Server-side execution is the default as it (should) be faster.
However, editing large numbers of pages will cause server timeouts due to PHP limits on script execution time. To work around this (and perhaps to get better feedback on progress), you can tick "execute in browser" to have the job tracking done on the client side. This should mean timeouts are no longer a problem.
- Page not found
In (at least) MediaWiki 1.31 and later, when the regex you provide is invalid, it will falsely indicate that all of the pages you selected for replacement are not found.
- Replacement in certain namespaces
If you would like to replace text only in certain namespaces, e.g., "File" and enter this with the page prefix option, you will get the following note: "Error: The MediaWiki API returned the error code invalidtitle: Bad title "File:"."
関連項目
- Extension:Replace Text — A similar extension which however will not work if you set
$wgCompressRevisions = true;for your wiki. - Extension:RegexFunctions
| この拡張機能は以下のウィキ ファーム/ウィキ ホスト/パッケージに含まれています: |
- Extensions incompatible with 1.45/ja
- Stable extensions/ja
- Page action extensions/ja
- Special page extensions/ja
- SkinTemplateNavigation::Universal extensions/ja
- GPL licensed extensions/ja
- Extensions in Wikimedia version control/ja
- All extensions/ja
- Extensions included in Miraheze/ja
- Extensions included in MyWikis/ja
- Extensions included in ProWiki/ja
- Extensions included in Telepedia/ja
- Edit extensions/ja
