0.0.1 • Published 5 years ago

@hhlingyoko/ckeditor5-code-block v0.0.1

Weekly downloads
1
License
GPL-2.0-or-later
Repository
github
Last release
5 years ago

CKEditor 5 Code-Block Feature

npm version

Having a trouble implement code blocks into CKEditor 5? So did I.

This package implements code block support for CKEditor 5. I took the built-in blockquote plugin, and edited it - the result is a new feature - the code-block option in the toolbar, which saves the paragraph into <code> element.

See https://github.com/ckeditor/ckeditor5/issues/436

Issues

Feel free to submit issues and enhancement requests.

Usage

In ckeditor5-build-classic project:

npm install https://github.com/MCFreddie777/ckeditor5-code-block

Update src/ckeditor.js with:

import CodeBlock from '@mcfreddie777/ckeditor5-code-block/src/codeblock';

ClassicEditor.builtinPlugins = [
  // ...
  CodeBlock,
  // ...
];

ClassicEditor.defaultConfig = {
  toolbar: {
    items: [
      // ...
      'codeBlock',
      // ...
    ]
  },
};

Then

npm run build