Sfoglia il codice sorgente

Merge branch 'master' into t/ckeditor5-ui/144

Aleksander Nowodzinski 8 anni fa
parent
commit
52e4c417db

BIN
.github/ckeditor 5 classic screeshot.png


+ 78 - 19
README.md

@@ -1,36 +1,82 @@
-CKEditor 5 – development repository
+CKEditor 5 [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Check%20out%20CKEditor%205%20on%20GitHub%20&url=https://github.com/ckeditor/ckeditor5)
 ===================================
+A set of ready to use rich text editors created with a powerful framework. Made with real-time collaborative editing in mind.
+
+![CKEditor 5 Classic editor build screenshot](https://github.com/ckeditor/ckeditor5/blob/master/.github/ckeditor%205%20classic%20screeshot.png)
 
 [![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)
 [![Build Status](https://travis-ci.org/ckeditor/ckeditor5.svg?branch=master)](https://travis-ci.org/ckeditor/ckeditor5)
 [![Dependency Status](https://img.shields.io/david/ckeditor/ckeditor5.svg)](https://david-dm.org/ckeditor/ckeditor5)
 [![devDependency Status](https://img.shields.io/david/dev/ckeditor/ckeditor5.svg)](https://david-dm.org/ckeditor/ckeditor5?type=dev)
 
-## Project Status (November 2017)
+## Table of contents
+
+- [Quick start](#quick-start)
+  -  [CKEditor 5 Builds](#ckeditor-5-builds)
+     - [Classic editor](#classic-editor)
+  -  [CKEditor 5 Framework](#ckeditor-5-framework)
+- [Documentation and FAQ](#documentation-and-faq)
+- [Contributing and project organization](#contributing-and-project-organization)
+  - [Ideas and discussions](#ideas-and-discussions)
+  - [Development](#development)
+  - [Reporting issues and feature requests](#reporting-issues-and-feature-requests)
+- [Releases](#releases)
+- [Packages](#packages)
+  - [Core libraries](#core-libraries)
+  - [Editors](#editors)
+  - [Features](#features)
+  - [Themes](#themes)
+  - [Builds](#builds)
+- [License](#license)
+
+## Quick start
+
+### CKEditor 5 Builds
+
+CKEditor 5 Builds are a set of ready to use rich text editors. Every "build" provides a single type of editor with a set of features and a default configuration.
+
+The following CKEditor 5 Builds are currently available:
+- [Classic editor](https://docs.ckeditor.com/ckeditor5/latest/builds/guides/overview.html#Classic-editor)
+- [Inline editor](https://docs.ckeditor.com/ckeditor5/latest/builds/guides/overview.html#Inline-editor)
+- [Balloon editor](https://docs.ckeditor.com/ckeditor5/latest/builds/guides/overview.html#Balloon-editor)
+
+#### Classic editor
 
-1.0.0-alpha.2 was released on November 14, 2017. This is the 13th developer preview of the new CKEditor 5.
+Creating an editor using a CKEditor 5 build is very simple and can be described in two steps:
+1. Load the desired editor via the <script> tag.
+2. Call the static create() method to create the editor.
 
-Read more about the status of the project in the [CKEditor 5 v1.0.0-alpha.2 release blog post](https://github.com/ckeditor/ckeditor5-design/issues/182).
+In your HTML page add an element that CKEditor should replace:
 
-The first alpha versions will be followed by several releases before CKEditor 5 reaches v1.0.0. See the [roadmap to 1.0.0 and beyond](https://github.com/ckeditor/ckeditor5-design/issues/172).
+`<textarea name="content" id="editor"></textarea>`
 
-## Demos
+Load CKEditor 5, the classic editor build (here [CDN](https://cdn.ckeditor.com/) location is used):
 
-To play with the editors see the [CKEditor 5 Builds](https://ckeditor.com/ckeditor-5-builds/) website.
+`<script src="https://cdn.ckeditor.com/ckeditor5/1.0.0-alpha.2/classic/ckeditor.js"></script>`
 
-You can also find out more examples (such as [Markdown output](https://docs.ckeditor.com/ckeditor5/latest/features/markdown.html) or [text autoformatting](https://docs.ckeditor.com/ckeditor5/latest/features/autoformat.html)) in the [Features](https://docs.ckeditor.com/ckeditor5/latest/features/index.html) section of the documentation.
+Call the [ClassicEditor.create()](https://docs.ckeditor.com/ckeditor5/latest/api/module_editor-classic_classiceditor-ClassicEditor.html#create) method:
 
-### Follow us!
+```
+<script>
+    ClassicEditor
+        .create( document.querySelector( '#editor' ) )
+        .catch( error => {
+            console.error( error );
+        } );
+</script>
+```
 
-* [Periodic news and updates](https://github.com/ckeditor/ckeditor5-design/labels/announcement) about the project.
-* [Roadmap to 1.0.0 and beyond](https://github.com/ckeditor/ckeditor5-design/issues/172).
+You’re ready to go!
 
-## Documentation
+To find out how to start with other builds please go to the [quick start section of CKEditor 5 documentation](https://docs.ckeditor.com/ckeditor5/latest/builds/guides/quick-start.html).
 
-For a high-level overview of the project see:
+### CKEditor 5 Framework
 
-* [CKEditor 5 Builds](https://ckeditor.com/ckeditor-5-builds/) website
-* [CKEditor 5 Framework](https://ckeditor.com/ckeditor-5-framework/) website.
+CKEditor 5 Builds allow you to quickly and easily initialize one of the many types of editors in your application. At the same time, CKEditor 5 is also a framework for creating custom-made rich text editing solutions.
+
+To find out how to start building your own editor from scratch go to [CKEditor 5 Framework overview section of CKEditor 5 documentation](https://docs.ckeditor.com/ckeditor5/latest/framework/guides/overview.html). 
+
+## Documentation and FAQ
 
 To find out more see the following [CKEditor 5 documentation](https://docs.ckeditor.com/ckeditor5/latest/index.html) sections:
 
@@ -42,13 +88,14 @@ To find out more see the following [CKEditor 5 documentation](https://docs.ckedi
 
 The documentation is far from being complete and will be constantly evolving (as will the editor) until it is ready for v1.0.0.
 
-## Project Organization
+For FAQ please go to the [CKEditor Ecosystem help center](https://support.ckeditor.com/hc/en-us).
+For a high-level overview of the project see the [CKEditor Ecosystem website](https://ckeditor.com).
 
-### Design and discussions
+## Contributing and project organization
 
-[https://github.com/ckeditor/ckeditor5](https://github.com/ckeditor/ckeditor5) is the CKEditor 5 main development repository. This is the best place for bringing opinions and contributions. Letting the core team know if they are going in the right or wrong direction is great feedback and will be much appreciated!
+### Ideas and discussions
 
-(Note: At the early stage, most of the high-level discussions were lead in [ckeditor5-design](https://github.com/ckeditor/ckeditor5-design/issues) repository.)
+The main development repository of CKEditor 5 is located at [https://github.com/ckeditor/ckeditor5](https://github.com/ckeditor/ckeditor5). This is the best place for bringing opinions and contributions. Letting the core team know if they are going in the right or wrong direction is great feedback and will be much appreciated!
 
 ### Development
 
@@ -62,6 +109,18 @@ Each repository independently handles its issues. However, it's recommended to r
 
 Read more in the [Support](https://docs.ckeditor.com/ckeditor5/latest/framework/guides/support/getting-support.html) page.
 
+## Releases
+
+The latest five releases:
+
+* [Second alpha release of CKEditor 5 v1.0.0](https://ckeditor.com/blog/Second-alpha-release-of-CKEditor-5-v1.0.0/)
+* [First alpha release of CKEditor 5 v1.0.0](https://ckeditor.com/blog/First-alpha-release-of-CKEditor-5-v1.0.0/)
+* [11th developer preview of CKEditor 5](https://ckeditor.com/blog/11th-developer-preview-of-CKEditor-5-available/)
+* [10th developer preview of CKEditor 5 available](https://ckeditor.com/blog/10th-developer-preview-of-CKEditor-5-available/)
+* [9th developer preview of CKEditor 5 available](https://ckeditor.com/blog/9th-developer-preview-of-CKEditor-5-available/)
+
+For more CKEditor 5 release blog posts [browse the CKEditor blog](https://ckeditor.com/blog/?category=releases&tags=CKEditor-5).
+
 ## Packages
 
 ### Core libraries

+ 4 - 4
docs/builds/guides/development/custom-builds.md

@@ -106,12 +106,12 @@ module.exports = {
 		'../relative/path/to/some/othercustomplugin'
 	],
 
-	// UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format.
-	language: 'en',
-
 	// Editor configuration.
 	config: {
-		toolbar: [ 'headings', 'bold', 'italic', 'custombutton' ]
+		toolbar: [ 'headings', 'bold', 'italic', 'custombutton' ],
+
+		// UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format.
+		language: 'en'
 	}
 };
 ```

+ 2 - 6
docs/builds/guides/integration/advanced-setup.md

@@ -11,7 +11,7 @@ In this guide, we would like to show you ways to closer integrate CKEditor with
 
 ## Bundler
 
-CKEditor 5 is currently built using [webpack](https://webpack.js.org) (>=2.x.x). All builds, examples and demos are generated using this bundler. It should also be possible to build CKEditor using other bundlers (if they are configured properly), such as [Rollup](https://github.com/rollup/rollup) or [Browserify](http://browserify.org/) but these setups are not officially supported yet. Also, the [`@ckeditor/ckeditor5-dev-webpack-plugin`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-webpack-plugin) that allows to localize the editor is only available for webpack. More work on this subject will be done after v1.0.0.
+CKEditor 5 is currently built using [webpack](https://webpack.js.org) (>=3.x.x). All builds, examples and demos are generated using this bundler. It should also be possible to build CKEditor using other bundlers (if they are configured properly), such as [Rollup](https://github.com/rollup/rollup) or [Browserify](http://browserify.org/) but these setups are not officially supported yet. Also, the [`@ckeditor/ckeditor5-dev-webpack-plugin`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-webpack-plugin) that allows to localize the editor is only available for webpack. More work on this subject will be done after v1.0.0.
 
 Therefore, **a prerequisite to this guide is that you are using webpack as your build tool**.
 
@@ -19,10 +19,6 @@ Therefore, **a prerequisite to this guide is that you are using webpack as your
 
 This is the simplest scenario. It assumes that you want to use {@link builds/guides/overview#Available-builds one of the existing builds} "as-is" (you can, of course, still {@link builds/guides/integration/configuration configure the editor}). It also gives the fastest build times.
 
-<info-box>
-	At the current stage, builds are only available in English. {@link features/ui-language Setting editor UI language} requires rebuilding the editor which means that this scenario is quite limited.
-</info-box>
-
 First, install the build of your choice {@link builds/guides/integration/installation#npm from npm}:
 
 ```bash
@@ -119,7 +115,7 @@ module.exports = {
 
 		new CKEditorWebpackPlugin( {
 			// See https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/features/ui-language.html
-			languages: [ 'pl' ]
+			language: 'pl'
 		} )
 	],
 

+ 6 - 0
docs/builds/guides/support/getting-support.md

@@ -41,3 +41,9 @@ DON'Ts:
 * The editor crashes if I press Enter. Please help.
 
 And most importantly, be kind to everyone.
+
+## Commercial support
+
+CKEditor 5 also comes with commercial licensing benefits, such as direct support from the core CKEditor development team. Commercial licenses are designed with professionals and enterprises in mind.
+
+For more information, check the [CKEditor 5 Pricing page](https://ckeditor.com/ckeditor-5-builds/pricing/).

+ 87 - 6
docs/features/ui-language.md

@@ -13,9 +13,60 @@ See the demo of the editor in German:
 
 {@snippet features/ui-language}
 
+## Loading additional languages from CDN, npm and zip file
+
+You can load additional languages using:
+* [CDN](#CDN),
+* [npm](#npm),
+* [Zip download](#Zip).
+
+Next, configure the editor to use chosen language:
+
+```js
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		language: 'de'
+	} )
+	.then( editor => {
+		console.log( editor );
+	} )
+	.catch( error => {
+		console.error( error );
+	} );
+```
+
+### CDN
+
+To use different language than default one (English), you need to load the editor together with the preferred language:
+
+```html
+<script src="https://cdn.ckeditor.com/ckeditor5/[version.number]/[distribution]/ckeditor.js"></script>
+<script src="https://cdn.ckeditor.com/ckeditor5/[version.number]/[distribution]/lang/de.js"></script>
+```
+
+See {@link builds/guides/integration/installation#CDN CDN installation guides} for more information.
+
+### npm
+
+After installing the build from npm, languages will be available at `node_modules/@ckeditor/ckeditor5-build-[name]/build/lang/[lang].js`.
+Single language can be loaded directly to your code by importing `'@ckeditor/ckeditor5-build-[name]/build/lang/de.js'`.
+
+See {@link builds/guides/integration/installation#npm npm installation guides} for more information.
+
+### Zip
+
+All additional languages are included in `.zip` file. You need to include `ckeditor.js` file together with language file:
+
+```js
+<script src="[ckeditor-path]/ckeditor.js"></script>
+<script src="[ckeditor-path]/lang/de.js"></script>
+```
+
+See {@link builds/guides/integration/installation#Zip-download zip installation guides} for more information.
+
 ## Building the editor using a specific language
 
-Currently, it is only possible to change the UI language at the build stage. A single build of the editor supports only the language which was defined in the [CKEditor 5 webpack plugin](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-webpack-plugin)'s configuration.
+Currently, it is possible to change the UI language at the build stage and after the build. A single build of the editor supports the language which was defined in the [CKEditor 5 webpack plugin](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-webpack-plugin)'s configuration. See the whole translation process to see how you can change the language later.
 
 If you use one of the {@link builds/index predefined editor builds}, refer to {@link builds/guides/development/custom-builds Creating custom builds} to learn how to change the language of your build.
 
@@ -37,8 +88,19 @@ If you build CKEditor from scratch or integrate it directly into your applicatio
 	// Define webpack plugins ...
 		plugins: [
 			new CKEditorWebpackPlugin( {
-				// Note: The plugin is currently able to build just one language at a time.
-				languages: [ 'pl' ]
+				// Main language that will be built in to the main bundle.
+				language: 'en',
+
+				// Additional languages that will be emitted to the `outputDirectory`.
+				// This option can be set to array of language codes or `'all'` to build all found languages.
+				// The bundle is optimized for one language when this option is omitted.
+				additionalLanguages: 'all',
+
+				// outputDirectory - optional directory for emitted translations, `'lang'` by default, relative to the webpack's output.
+
+				// strict - will cause the building process to fail if an error is found during the building process.
+
+				// verbose - will cause logging all warnings into the console
 			} ),
 
 			// Other webpack plugins...
@@ -46,10 +108,29 @@ If you build CKEditor from scratch or integrate it directly into your applicatio
 	// ...
 	```
 
-3. Run webpack. The CKEditor plugin for webpack will replace the {@link module:utils/locale~Locale#t `t()`} function calls used in the source code with localized language strings.
+3. Run webpack. If the `additionalLanguages` option is not set, the CKEditor plugin for webpack will replace the {@link module:utils/locale~Locale#t `t()`} function call parameters used in the source code with localized language strings. Otherwise the CKEditor plugin for webpack will replace the {@link module:utils/locale~Locale#t `t()`} function call parameters with short ids and emit the translation files that should land in the `'lang'` directory (or different, if the `outputDirectory` option is specified).
+
+4. If you want to change the language after the build ends, you will need to edit the `index.html` file, add the translation file and set the UI language to the target one.
+
+	```html
+	<script src="../build/ckeditor.js"></script>
+	<script src="../build/lang/pl.js"></script>
+	<script>
+		ClassicEditor
+			.create( document.querySelector( '#editor' ), {
+				language: 'pl'
+			} )
+			.then( editor => {
+				window.editor = editor;
+			} )
+			.catch( err => {
+				console.error( err.stack );
+			} );
+	</script>
+	```
 
 <info-box>
-	We are aware that the current localization method is not sufficient for all needs. It neither supports different bundlers (e.g. Rollup or Browserify) nor building multiple languages (to make it possible to pick one at runtime). We will be extending the localization possiblities in the near future.
+	We are aware that the current localization method is not sufficient for all needs. It doesn't support different bundlers (e.g. Rollup or Browserify). We will be extending the localization possibilities in the future.
 
-	You can read more about the used techniques and future plans in the ["Implement translation services" issue](https://github.com/ckeditor/ckeditor5/issues/387).
+	You can read more about the used techniques in the ["Implement translation services" issue](https://github.com/ckeditor/ckeditor5/issues/387) and ["Implement translation services v2" issue](https://github.com/ckeditor/ckeditor5/issues/624).
 </info-box>

+ 6 - 0
docs/framework/guides/support/getting-support.md

@@ -41,3 +41,9 @@ DON'Ts:
 * The editor crashes if I press Enter. Please help.
 
 And most importantly, be kind to everyone.
+
+## Commercial support
+
+CKEditor 5 also comes with commercial licensing benefits, such as direct support from the core CKEditor development team. Commercial licenses are designed with professionals and enterprises in mind.
+
+For more information, check the [CKEditor 5 Pricing page](https://ckeditor.com/ckeditor-5-builds/pricing/).

+ 1 - 1
scripts/docs/snippet-adapter/package.json

@@ -2,7 +2,7 @@
   "name": "ckeditor5-snippet-adapter",
   "private": true,
   "dependencies": {
-    "@ckeditor/ckeditor5-dev-webpack-plugin": "^2.0.18",
+    "@ckeditor/ckeditor5-dev-webpack-plugin": "^3.0.0",
     "babel-minify-webpack-plugin": "^0.2.0",
     "extract-text-webpack-plugin": "^3.0.0",
     "raw-loader": "^0.5.1",

+ 1 - 1
scripts/docs/snippet-adapter/snippetadapter.js

@@ -82,7 +82,7 @@ function getWebpackConfig( config ) {
 	const plugins = [
 		new ExtractTextPlugin( 'snippet.css' ),
 		new CKEditorWebpackPlugin( {
-			languages: [ config.language || 'en' ]
+			language: config.language || 'en'
 		} ),
 		new webpack.BannerPlugin( {
 			banner: bundler.getLicenseBanner(),