CKEditor CodeMirror
Component ID
2681889
Component name
CKEditor CodeMirror
Component type
module
Maintenance status
Development status
Component security advisory coverage
covered
Downloads
11424
Component created
Component changed
Component body
CKEditor CodeMirror module adds syntax highlighting for "Source View" in CKEditor WYSIWYG editor using CKEditor CodeMirror Plugin.
Drupal 8
Dependencies
- Libraries API (8.x-3.x) module https://www.drupal.org/project/libraries
- CKEditor-CodeMirror-Plugin library https://github.com/w8tcha/CKEditor-CodeMirror-Plugin
Installation
- Download and install the Libraries API module.
- Download and install CKEditor CodeMirror module.
- Download CKEditor-CodeMirror-Plugin library to the following directory
libraries/ckeditor.codemirror. Path toplugin.jsfile should belibraries/ckeditor.codemirror/plugin.js.
Configuration
- Go to "Administration » Configuration » Content authoring » Text formats and editors" (
admin/config/content/formats) page. - Click "Configure" for any text format using CKEditor as the text editor.
- Under "CKEditor plugin settings", click "CodeMirror" and check "Enable CodeMirror source view syntax highlighting". Make sure that the current toolbar has the "Source" button. Adjust other settings as desired.
- Scroll down and click "Save configuration".
- Go to node create/edit page, choose the text format with CodeMirror plugin. Press the "Source" button.
Drupal 7
Dependencies
- CKEditor module https://www.drupal.org/project/ckeditor
- Libraries API (2.x) module https://www.drupal.org/project/libraries
- CKEditor-CodeMirror-Plugin library https://github.com/w8tcha/CKEditor-CodeMirror-Plugin
Installation
- Download and install CKEditor and Libraries API modules.
- Download and install CKEditor CodeMirror module.
- Download CKEditor-CodeMirror-Plugin library to the following directory
sites/all/libraries/ckeditor.codemirror. Path toplugin.jsfile should besites/all/libraries/ckeditor.codemirror/plugin.js. Note: Latest version of module will offer to do this for you automatically.
Usedrush ckeditor-codemirror-download(ordrush ccmd) command to download the library.
Configuration
- Go to "Administration » Configuration » Content authoring" (
admin/config/content/ckeditor) page and edit any CKEditor profile. - Under "Editor appearance" section scroll down to "Plugins" list, enable "CodeMirror (Source) Syntax Highlighting" plugin. Make sure that the current toolbar has the "Source" button. Save the profile.
- Go to node create/edit page, choose the text format with CodeMirror plugin. Press the "Source" button.
