Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2 from ckeditor/t/1
Browse files Browse the repository at this point in the history
Feature: Implement the document editor build on top of the decoupled editor. Closes #1.
  • Loading branch information
Reinmar authored Mar 13, 2018
2 parents c9848d5 + 48593e7 commit 5bf2a07
Show file tree
Hide file tree
Showing 56 changed files with 950 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
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>.
23 changes: 23 additions & 0 deletions LICENSE.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.
75 changes: 75 additions & 0 deletions README.md
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.
9 changes: 9 additions & 0 deletions bin/build-ckeditor.sh
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."
18 changes: 18 additions & 0 deletions bin/create-entry-file.js
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.' );
78 changes: 78 additions & 0 deletions build-config.js
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'
}
};
7 changes: 7 additions & 0 deletions build/ckeditor.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/ckeditor.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/translations/ast.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/translations/bg.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/translations/da.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/translations/de.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/translations/el.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/translations/en-au.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/translations/eo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/translations/es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/translations/et.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/translations/fi.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/translations/fr.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5bf2a07

Please sign in to comment.