1.0.2 • Published 4 years ago

techfox-editor v1.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

CKEditor 5 document editor build

CKEditor 5 TechfoxEditor document editor build screenshot

Quick start

First, install the build from npm:

npm install --save techfox-editor

And use it in your website:

<div id="toolbar-container"></div>
<div id="editor">
  <p>This is the editor content.</p>
</div>
<script src="./node_modules/techfox-editor/build/ckeditor.js"></script>
<script>
  TechfoxEditor
    .create( document.querySelector( '#editor' ) )
    .then( editor => {
      // The toolbar needs to be explicitly appended.
      document.querySelector( '#toolbar-container' ).appendChild( editor.ui.view.toolbar.element );

      window.editor = editor;
    } )
    .catch( error => {
      console.error( 'There was a problem initializing the editor.', error );
    } );
</script>

Or in your JavaScript application:

import TechfoxEditor from 'techfox-editor';

// Or using the CommonJS version:
// const TechfoxEditor = require( 'techfox-editor' );

TechfoxEditor
  .create( document.querySelector( '#editor' ) )
  .then( editor => {
    // The toolbar needs to be explicitly appended.
    document.querySelector( '#toolbar-container' ).appendChild( editor.ui.view.toolbar.element );

    window.editor = editor;
  } )
  .catch( error => {
    console.error( 'There was a problem initializing the editor.', error );
  } );