This extension
comes with MediaWiki 1.31and above. Thus you do not have to download it again. However, you still need to follow the other instructions provided.
The CodeEditor extension extends the WikiEditor advanced editing toolbar with an embedded Ace editor widget, providing some handy features for user/site JavaScript pages, CSS pages, JSON pages, and when extension Scribunto is also installed, for Lua pages, i.e. pages in the Module namespace. 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.)
It provides the following features:
The
WikiEditorextension needs to be installed for this extension to work. Installing the
Scribuntoextension is optional.
CodeEditor
folder to your extensions/
directory.cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
wfLoadExtension( 'CodeEditor' ); $wgDefaultUserOptions['usebetatoolbar'] = 1; // user option provided by WikiEditor extension
Vagrant installation:
vagrant roles enable codeeditor --provision
$wgCodeEditorEnableCore
$wgCodeEditorEnableCore = false;
(default is "true")
$wgCodeEditorContentModels
$wgScribuntoUseCodeEditor
$wgScribuntoUseCodeEditor = false;
(default is "true")
This configuration parameter is provided by the Scribunto extension and must therefore be added after invoking the CodeEditor as well as the Scribunto extension which also needs to be installed for this to work.
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 module-jquery.textSelection.$.fn.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).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4