Extension:CodeEditor/cs


 * Not to be confused with CodeMirror.

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 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 for syntax highlighting of wikitext when using the source editor.)

It provides the following features:


 * syntax highlighting for JavaScript, CSS and Lua
 * auto-indent
 * tab key produces tab indents (since 1.22), soft indents before.
 * indent/unindent selection with Tab/Shift-Tab keys
 * syntax validity check for JavaScript
 * Pair-matching for parenthesis, braces and square brackets

Configuration

 * To disable the editor on JavaScript and CSS pages in the MediaWiki, User and other core namespaces, set (default is "true")
 * To disable the editor on JavaScript and CSS pages in the MediaWiki, User and other core namespaces, set (default is "true")


 * To disable this extension for Scribunto, i.e. in the module namespace set (default is "true")
 * To disable this extension for Scribunto, i.e. in the module namespace set (default is "true")

JavaScript
It is possible to change the configuration of the ACE editor, by hooking into the MediaWiki JS hook (i.e. ). 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.

License
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).