CodeEditor

CodeEditor enables the Ace code editor for desktop editing on Fandom. The code editor offers syntax highlighting and text replacement.

Installation
This script can be installed for personal use. This enables the code editor if a supported language can be detected.

To consistently use Ace on desktop (overriding source editor preferences), set  to true.

Library
The script also has a library for code editing. The library will likely be permitted sitewide via custom scripts that make it operate on JSON or LESS pages etc.


 * Conditional, configurable boot handler.
 * Initialises editor when all conditionals are valid.
 * Arguments:  - Configuration object.
 * Arguments:  - Configuration object.


 * ·  (string/array; optional)
 * Mode(s) for Ace to initialise, by descending priority.
 * Fallbacks to automatic mode name based on SUBPAGENAME.


 * (boolean; optional)
 * Whether the mode & booting is determined automatically.
 * A mode array can be supplied in automatic mode.


 * ·  (RegExp; optional)
 * Regular expression tested against FULLPAGENAME.


 * ·   (string/array; optional)
 * Page name to test against FULLPAGENAME.


 * Returns: Script bootloading event; thenable.


 * Bootloader for script editing.
 * Argument:  - Mode Ace submodule key.
 * Returns: Script bootloading event; thenable.
 * Returns: Script bootloading event; thenable.

Modelist module

 * (object)
 * Modelist submodule for CodeEdtitor.
 * Members:


 * (object)
 * Parsed mode data map for the Fandom Ace editor.
 * Maps Ace mode submodule name to relevant mode data.


 * Mode Ace submodule key.
 * Mode Ace submodule key.


 * Mode code language caption.
 * Mode code language caption.


 * Ace submodule identifier.
 * Ace submodule identifier.


 * Pipe-delimited extension list.
 * Pipe-delimited extension list.


 * Regular expression for mode detection.
 * Regular expression for mode detection.


 * (function)
 * Path getter for automatic mode detection.
 * Argument:  - Full path of current file.
 * Returns: Detected mode of current file, or null (optional).



List of modes
There are 101 language modes supported by CodeEditor currently.

Linting is available for the following code languages:
 * CoffeeScript
 * CSS
 * JavaScript
 * JSON
 * Lua
 * PHP
 * XQuery