Extension:CodeEditor
![]() リリースの状態: 安定 |
|
---|---|
![]() |
|
説明 | サイトや利用者のJavaScript、CSS、Luaページ用、構文強調コードエディターを提供します。これは高機能編集ツールバーに統合されたものです。 |
作者 |
|
互換性の方針 | MediaWikiとともにリリースされるスナップショット。 master には後方互換性がありません。 |
MediaWiki | 1.32+ |
データベースの変更 | いいえ |
ライセンス | GPL-2.0-or-later AND BSD-3-Clause |
ダウンロード | |
|
|
Quarterly downloads | 243 (Ranked 46th) |
Public wikis using | 8,385 (Ranked 17th) |
translatewiki.net で翻訳を利用できる場合は、CodeEditor 拡張機能の翻訳にご協力ください | |
問題点 | 未解決のタスク · バグを報告 |
CodeEditor拡張機能はWikiEditor高機能編集ツールバーを埋め込み、Ace エディター ウィジェットで拡張して、利用者やサイトがJavaScript、CSS、JSONのページを編集するときに便利な機能を提供します。そして拡張機能Scribunto もインストールされている場合はLuaページ、すなわちModule名前空間のページに対していくつかの便利な機能を提供します。 The code editor does not show on regular wiki pages, i.e. wiki pages with the "wikitext" content model. (See Extension:CodeMirror for syntax highlighting of wikitext when using the source editor.)
以下の機能を提供します:
- JavaScript・CSS・Luaのための構文ハイライト
- オートインデント
- tab key produces tab indents (since 1.22), soft indents before.
- tab / shift+tabによってインデントを下げたり戻したりできます
- JavaScriptの構文を検査します。
- Pair-matching for parenthesis, braces and square brackets
インストール
- ダウンロードして、ファイルを
extensions/
フォルダー内のCodeEditor
という名前のディレクトリ内に配置します。 - 以下のコードを
LocalSettings.php
の末尾に追加します:wfLoadExtension( 'CodeEditor' ); $wgDefaultUserOptions['usebetatoolbar'] = 1; // user option provided by WikiEditor extension
- 必要に応じて設定します。
- 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
Vagrant installation:
- Vagrant を使用している場合は、
vagrant roles enable codeeditor --provision
でインストールしてください。
設定
$wgCodeEditorEnableCore
- MediaWiki・利用者とその他の名前空間でJavascriptとCSSのエディターを無効にするには、
$wgCodeEditorEnableCore = false;
を設定します(デフォルトはtrue)。
$wgScribuntoUseCodeEditor
- To disable this extension for Scribunto, i.e. in the module namespace set
$wgScribuntoUseCodeEditor = false;
(default is "true")
JavaScript
It is possible to change the configuration of the ACE editor, by hooking into the MediaWiki JS hook (i.e. mw.hook( 'codeEditor.configure' ).add( ... )
).
The argument passed to your hook will be an ACE EditSession object.
If you need to interact with the contents of a CodeEditor instance, use jQuery.plugin.textSelection.
ライセンス
While this extension is licensed GNU General Public License v2.0 or later (GPL-2.0+) it makes use of the Ace editor software which is licensed BSD 3-clause "New" or "Revised" License (BSD-3-Clause).
この拡張機能は 1 つ以上のウィキメディアのプロジェクトで使用されています。 これはおそらく、この拡張機能が安定していて高いトラフィックのウェブサイトでも十分に動作することを意味します。 この拡張機能がインストールされている場所を確認するには、ウィキメディアの設定ファイル CommonSettings.php および InitialiseSettings.php 内で、この拡張機能の名前を探してください。 特定のウィキにインストールされている拡張機能の完全な一覧は、そのウィキの Special:Version ページにあります。 |
この拡張機能は以下のパッケージ/ウィキファームに含まれています: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |