Webanizr Logo
Open / sluit menu
Module codeMirror

The module codeMirror loads a Code Mirror editor on your website.

syntax

webanizr.collect('codeMirror', parameters, callback);

parameters

Quill accepts the following parameters:

id__dom (required)

The id of the DOM element the editor needs to be appended to.

mode__codemirror (required)

The syntax highlighting mode. A complete list of options can be found here:

https://codemirror.net/mode/

The selected option should be entered in lowercase, eg javascript or php.

value__editor (optional)

The initial value for the editor.

tab__size (optional)

The number of spaces to replace a tab. If not set: 4 spaces are used.

width__editor (optional)

The width of the edior. This can be either a number (the number of pixels) or a css definion like "80%".

height__editor (optional)

The height of the edior. This can be either a number (the number of pixels) or a css definion like "80%".

callback

The callback is called after the editor is loaded. The callback function is called with empty data.

demo

Syntax hightlighting for javascript, css and pug

https://cdn.cpmodules.webanizr.com/demo/code-mirror/index.html