CKEditor SDK - index

Inserting Code Snippets Documentation

The optional Code Snippet plugin, introduced in CKEditor 4.4, supports inserting beautiful code snippets into the editor content. By default the plugin depends on the built-in client-side syntax highlighting library highlight.js.

When the Code Snippet plugin is enabled, the   button is automatically added to the toolbar. Once clicked, it opens the Code snippet dialog window that lets you add a piece of code and set the programming language it is written in.

Using Syntax Highlighting

A few configuration options are available to fine-tune this feature, including setting a custom highlighter theme (see available themes), adjusting support for programming languages, or even implementing a different highlighter library. Refer to the Inserting Code Snippets article to learn more about this feature.

You can select a theme for the editor instance below here:

Please note that this plugin is not compatible with Internet Explorer 8.

GeSHi — Custom Highlighting Engine Example

The Code Snippet GeSHi plugin is an extension of the Code Snippet plugin. It implements the well-known GeSHi library with a server-side highlighter. See the Inserting Code Snippets Using GeSHi article for implementation details.

Related Features