You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
3.3 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. CKEditor 5 inline editor build
  2. ==============================================
  3. [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-build-inline.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-build-inline)
  4. [![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
  5. [![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://app.travis-ci.com/github/ckeditor/ckeditor5)
  6. ![Dependency Status](https://img.shields.io/librariesio/release/npm/@ckeditor/ckeditor5-build-inline)
  7. The inline editor build for CKEditor 5. Read more about the [inline editor build](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/predefined-builds.html#inline-editor) and see the [demo](https://ckeditor.com/docs/ckeditor5/latest/examples/builds/inline-editor.html).
  8. ![CKEditor 5 inline editor build screenshot](https://c.cksource.com/a/1/img/npm/ckeditor5-build-inline.png)
  9. ## Documentation
  10. See:
  11. * [Installation](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/quick-start.html) for how to install this package and what it contains.
  12. * [Editor lifecycle](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/editor-lifecycle.html) for how to create an editor and interact with it.
  13. * [Configuration](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/configuration.html) for how to configure the editor.
  14. * [Creating custom builds](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/quick-start.html#building-the-editor-from-source) for how to customize the build (configure and rebuild the editor bundle).
  15. ## Quick start
  16. First, install the build from npm:
  17. ```bash
  18. npm install --save @ckeditor/ckeditor5-build-inline
  19. ```
  20. And use it in your website:
  21. ```html
  22. <div id="editor">
  23. <p>This is the editor content.</p>
  24. </div>
  25. <script src="./node_modules/@ckeditor/ckeditor5-build-inline/build/ckeditor.js"></script>
  26. <script>
  27. InlineEditor
  28. .create( document.querySelector( '#editor' ) )
  29. .then( editor => {
  30. window.editor = editor;
  31. } )
  32. .catch( error => {
  33. console.error( 'There was a problem initializing the editor.', error );
  34. } );
  35. </script>
  36. ```
  37. Or in your JavaScript application:
  38. ```js
  39. import InlineEditor from '@ckeditor/ckeditor5-build-inline';
  40. // Or using the CommonJS version:
  41. // const InlineEditor = require( '@ckeditor/ckeditor5-build-inline' );
  42. InlineEditor
  43. .create( document.querySelector( '#editor' ) )
  44. .then( editor => {
  45. window.editor = editor;
  46. } )
  47. .catch( error => {
  48. console.error( 'There was a problem initializing the editor.', error );
  49. } );
  50. ```
  51. **Note:** If you are planning to integrate CKEditor 5 deep into your application, it is actually more convenient and recommended to install and import the source modules directly (like it happens in `ckeditor.js`). Read more in the [Advanced setup guide](https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/advanced-setup.html).
  52. ## License
  53. Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).