-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
Feature: Implement the document editor build on top of the decoupled editor. Closes #1.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Contributing | ||
======================================== | ||
|
||
Information about contributing can be found on the following page: <https://github.com/ckeditor/ckeditor5/blob/master/CONTRIBUTING.md>. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Software License Agreement | ||
========================== | ||
|
||
**CKEditor 5 document editor build** – https://github.com/ckeditor/ckeditor5-build-decoupled-document <br> | ||
Copyright (c) 2003-2018, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved. | ||
|
||
Licensed under the terms of any of the following licenses at your choice: | ||
|
||
* [GNU General Public License Version 2 or later (the "GPL")](http://www.gnu.org/licenses/gpl.html) | ||
* [GNU Lesser General Public License Version 2.1 or later (the "LGPL")](http://www.gnu.org/licenses/lgpl.html) | ||
* [Mozilla Public License Version 1.1 or later (the "MPL")](http://www.mozilla.org/MPL/MPL-1.1.html) | ||
|
||
You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "legal.txt" in your version of this software, indicating your license choice. In any case, your choice will not restrict any recipient of your version of this software to use, reproduce, modify and distribute this software under any of the above licenses. | ||
|
||
Sources of Intellectual Property Included in CKEditor | ||
----------------------------------------------------- | ||
|
||
Where not otherwise indicated, all CKEditor content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor will incorporate work done by developers outside of CKSource with their express permission. | ||
|
||
Trademarks | ||
---------- | ||
|
||
**CKEditor** is a trademark of [CKSource](http://cksource.com) Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
CKEditor 5 decoupled document build | ||
======================================== | ||
|
||
[![Join the chat at https://gitter.im/ckeditor/ckeditor5](https://badges.gitter.im/ckeditor/ckeditor5.svg)](https://gitter.im/ckeditor/ckeditor5?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-build-decoupled-document.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-build-decoupled-document) | ||
[![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-build-decoupled-document/status.svg)](https://david-dm.org/ckeditor/ckeditor5-build-decoupled-document) | ||
[![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-build-decoupled-document/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-build-decoupled-document?type=dev) | ||
|
||
The decoupled document build for CKEditor 5. Read more about the [decoupled document build]((https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/overview.html#document-editor) and see the [demo](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/examples/builds/document-editor.html). | ||
|
||
## Documentation | ||
|
||
See: | ||
|
||
* [Installation](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/installation.html) for how to install this package and what it contains. | ||
* [Basic API](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/basic-api.html) for how to create an editor and interact with it. | ||
* [Configuration](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/configuration.html) for how to configure the editor. | ||
* [Creating custom builds](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/development/custom-builds.html) for how to customize the build (configure and rebuild the editor bundle). | ||
|
||
## Quick start | ||
|
||
First, install the build from npm: | ||
|
||
``` | ||
npm install --save @ckeditor/ckeditor5-build-decoupled-document | ||
``` | ||
|
||
And use it in your website: | ||
|
||
```html | ||
<div id="editor"> | ||
<p>This is the editor content.</p> | ||
</div> | ||
<script src="./node_modules/@ckeditor/ckeditor5-build-decoupled-document/build/ckeditor.js"></script> | ||
<script> | ||
DecoupledDocumentEditor | ||
.create( '<h2>Hello world!</h2>', { | ||
toolbarContainer: '.toolbar-container', | ||
editableContainer: '.editable-container' | ||
} ) | ||
.then( editor => { | ||
window.editor = editor; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); | ||
</script> | ||
``` | ||
|
||
Or in your JavaScript application: | ||
|
||
```js | ||
import DecoupledDocumentEditor from '@ckeditor/ckeditor5-build-decoupled-document'; | ||
|
||
// Or using CommonJS verion: | ||
// const DecoupledDocumentEditor = require( '@ckeditor/ckeditor5-build-decoupled-document' ); | ||
|
||
DecoupledDocumentEditor | ||
.create( '<h2>Hello world!</h2>', { | ||
toolbarContainer: '.toolbar-container', | ||
editableContainer: '.editable-container' | ||
} ) | ||
.then( editor => { | ||
window.editor = editor; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); | ||
``` | ||
|
||
**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://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/advanced-setup.html). | ||
|
||
## License | ||
|
||
Licensed under the GPL, LGPL and MPL licenses, at your choice. For full details about the license, please check the `LICENSE.md` file. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Building 'build/ckeditor.js'..." | ||
echo "" | ||
|
||
webpack | ||
|
||
echo "" | ||
echo "Done." |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const path = require( 'path' ); | ||
const { bundler } = require( '@ckeditor/ckeditor5-dev-utils' ); | ||
const buildConfig = require( '../build-config' ); | ||
|
||
console.log( 'Creating the entry file...' ); | ||
|
||
bundler.createEntryFile( path.join( 'src', 'ckeditor.js' ), buildConfig ); | ||
|
||
console.log( 'Done.' ); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = { | ||
// The editor creator to use. | ||
editor: '@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor', | ||
|
||
// The name under which the editor will be exported. | ||
moduleName: 'DecoupledDocumentEditor', | ||
|
||
// Plugins to include in the build. | ||
plugins: [ | ||
'@ckeditor/ckeditor5-essentials/src/essentials', | ||
|
||
'@ckeditor/ckeditor5-alignment/src/alignment', | ||
'@ckeditor/ckeditor5-font/src/fontsize', | ||
'@ckeditor/ckeditor5-font/src/fontfamily', | ||
'@ckeditor/ckeditor5-highlight/src/highlight', | ||
'@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter', | ||
'@ckeditor/ckeditor5-autoformat/src/autoformat', | ||
'@ckeditor/ckeditor5-basic-styles/src/bold', | ||
'@ckeditor/ckeditor5-basic-styles/src/italic', | ||
'@ckeditor/ckeditor5-basic-styles/src/strikethrough', | ||
'@ckeditor/ckeditor5-basic-styles/src/underline', | ||
'@ckeditor/ckeditor5-block-quote/src/blockquote', | ||
'@ckeditor/ckeditor5-easy-image/src/easyimage', | ||
'@ckeditor/ckeditor5-heading/src/heading', | ||
'@ckeditor/ckeditor5-image/src/image', | ||
'@ckeditor/ckeditor5-image/src/imagecaption', | ||
'@ckeditor/ckeditor5-image/src/imagestyle', | ||
'@ckeditor/ckeditor5-image/src/imagetoolbar', | ||
'@ckeditor/ckeditor5-image/src/imageupload', | ||
'@ckeditor/ckeditor5-link/src/link', | ||
'@ckeditor/ckeditor5-list/src/list', | ||
'@ckeditor/ckeditor5-paragraph/src/paragraph', | ||
], | ||
|
||
// Editor config. | ||
config: { | ||
toolbar: { | ||
items: [ | ||
'heading', | ||
'|', | ||
'fontsize', | ||
'fontfamily', | ||
'|', | ||
'bold', | ||
'italic', | ||
'underline', | ||
'strikethrough', | ||
'highlight', | ||
'|', | ||
'alignment', | ||
'|', | ||
'numberedList', | ||
'bulletedList', | ||
'|', | ||
'link', | ||
'blockquote', | ||
'uploadImage', | ||
'|', | ||
'undo', | ||
'redo' | ||
] | ||
}, | ||
|
||
image: { | ||
toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ] | ||
}, | ||
|
||
// UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format. | ||
language: 'en' | ||
} | ||
}; |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.