This plugin lets you insert rich code snippets with syntax highlighting into the editor.
The default implementation uses the integrated highlight.js library, but the plugin can be easily customized to use a different syntax highlighter, including a server-side one. An example of such implementation is the Code Snippet GeSHi plugin that is an extension of this plugin.
Additionally, the you can also use the following configuration options:
- config.codeSnippet_theme - to change the default highlighter theme.
- config.codeSnippet_languages - to change the list of supported languages.
See the Code Snippet plugin documentation for more information.
This is an official plugin provided and supported by CKEditor developers.
The recommended way to install all CKEditor add-ons is to create a custom build by using Online builder. To do that, click the Add to my editor button on the plugin page. When you are done, click the Build my editor button on the right side of the page to go to Online builder.
Note: This add-on is already selected to be a part of your current build.
Add-on installation instructions
If you want to add the plugin manually, you will need to:
- Extract the downloaded plugin
pluginsfolder of your CKEditor installation. Example:
- Enable the plugin by using the
extraPluginsconfiguration setting. Example:
config.extraPlugins = 'codesnippet';
- Download and configure all its dependencies, too.
|Plugin versions||CKEditor versions|
The first minor release for CKEditor 4.13.
The first bug fixing release for CKEditor 4.12.
The fourth bug fixing release for CKEditor 4.11.