瀏覽代碼

Various wording improvements and cleanups.

Piotrek Koszuliński 6 年之前
父節點
當前提交
c7b2cc6bf9

+ 3 - 3
packages/ckeditor5-indent/README.md

@@ -1,5 +1,5 @@
-CKEditor 5 indent block feature
-===========================
+CKEditor 5 block indentation feature
+====================================
 
 [![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-indent.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-indent)
@@ -10,7 +10,7 @@ CKEditor 5 indent block feature
 [![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-indent/status.svg)](https://david-dm.org/ckeditor/ckeditor5-indent)
 [![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-indent/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-indent?type=dev)
 
-This package implements indentation support for CKEditor 5.
+This package implements block indentation support for CKEditor 5.
 
 ## Documentation
 

+ 1 - 1
packages/ckeditor5-indent/docs/_snippets/features/custom-indent-block-classes.js

@@ -14,8 +14,8 @@ ClassicEditor
 			items: [
 				'heading',
 				'|',
-				'indent',
 				'outdent',
+				'indent',
 				'|',
 				'bulletedList',
 				'numberedList',

+ 1 - 5
packages/ckeditor5-indent/docs/_snippets/features/indent.js

@@ -14,8 +14,8 @@ ClassicEditor
 			items: [
 				'heading',
 				'|',
-				'indent',
 				'outdent',
+				'indent',
 				'|',
 				'bulletedList',
 				'numberedList',
@@ -24,10 +24,6 @@ ClassicEditor
 				'redo'
 			],
 			viewportTopOffset: window.getViewportTopOffsetConfig()
-		},
-		indentBlock: {
-			offset: 50,
-			unit: 'px'
 		}
 	} )
 	.then( editor => {

+ 3 - 3
packages/ckeditor5-indent/docs/api/indent.md

@@ -2,7 +2,7 @@
 category: api-reference
 ---
 
-# CKEditor 5 indent feature
+# CKEditor 5 block indent feature
 
 [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-indent.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-indent)
 
@@ -10,11 +10,11 @@ This package implements the indent feature for CKEditor 5.
 
 ## Demo
 
-Check out the {@link features/indent#demo demo in the indent feature} guide.
+Check out the {@link features/indent#demo demo in the block indentation feature} guide.
 
 ## Documentation
 
-See the {@link module:indent/indent~Indent} plugin documentation.
+See the {@link features/indent Block indentation} guide and the {@link module:indent/indent~Indent} plugin documentation.
 
 ## Installation
 

+ 41 - 12
packages/ckeditor5-indent/docs/features/indent.md

@@ -15,9 +15,11 @@ The indentation feature allows to set indentation of text blocks like paragraphs
 
 ### Using offset and unit
 
-By default the block indentation is controlled by setting the indentation step offset and unit. Executing indent (or outdent) commands will increase (or decrease) current block indentation by given offset.
+By default, the block indentation feature increases or decreases the current indentation by the given offset, using the given unit.
 
-The editor ind the {@link features/indent#demo demo} section was configured using offset and unit:
+The editor used in the {@link features/indent#demo demo} section above uses the default configuration, which defines a `40px` indentation step.
+
+You can change that value to, for example, `1em`:
 
 ```js
 import Indent from '@ckeditor/ckeditor5-indent/src/indent';
@@ -26,11 +28,11 @@ ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ Indent, ... ],
 		toolbar: {
-			items: [ 'heading', '|', 'indent', 'outdent', '|', 'bulletedList', 'numberedList', '|', 'undo', 'redo' ]
+			items: [ 'heading', '|', 'outdent', 'indent', '|', 'bulletedList', 'numberedList', '|', 'undo', 'redo' ]
 		},
 		indentBlock: {
-			offset: 50,
-			unit: 'px'
+			offset: 1,
+			unit: 'em'
 		}
 	} )
 	.then( ... )
@@ -39,7 +41,7 @@ ClassicEditor
 
 ### Using CSS classes
 
-Alternatively the block indentation feature can be configured to set indentation by applying one of defined CSS classes:
+Alternatively, the block indentation feature can be configured to set indentation by applying one of defined CSS classes:
 
 ```js
 import Indent from '@ckeditor/ckeditor5-indent/src/indent';
@@ -49,7 +51,7 @@ ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ Indent, IndentBlock, ... ],
 		toolbar: {
-			items: [ 'heading', '|', 'indent', 'outdent', '|', 'bulletedList', 'numberedList', '|', 'undo', 'redo' ]
+			items: [ 'heading', '|', 'outdent', 'indent', '|', 'bulletedList', 'numberedList', '|', 'undo', 'redo' ]
 		},
 		indentBlock: {
 			classes: [
@@ -93,12 +95,25 @@ In the demo below the CSS classes are defined as follows:
 
 {@snippet features/custom-indent-block-classes}
 
+## Indenting lists
+
+The same set of buttons (`outdent`, `indent`), besides controlling block indentation, allows indenting list items (nesting them). This is completely transparent to the user.
+
+From the code perspective, the buttons are implemented by the {@link module:indent/indent~Indent} plugin, but neither those buttons nor respective commands implement any functionality by default.
+
+The target behavior comes in two other plugins:
+
+* {@link module:indent/indentblock~IndentBlock} — The indent block feature controls the indentation of elements such as paragraphs and headings.
+* {@link module:list/list~List} — The list feature implements the indentation (nesting) of lists.
+
+This means, that if you want to allow indenting lists only, you can do that by load only the `Indent` and `List` plugins. If you want the full behavior, you need to load all 3 plugins.
+
 ## Installation
 
-To add this feature to your editor, install the [`@ckeditor/ckeditor5-indent-block`](https://www.npmjs.com/package/@ckeditor/ckeditor5-indent-block) package:
+To add this feature to your editor, install the [`@ckeditor/ckeditor5-indent`](https://www.npmjs.com/package/@ckeditor/ckeditor5-indent) package:
 
 ```bash
-npm install --save @ckeditor/ckeditor5-indent-block
+npm install --save @ckeditor/ckeditor5-indent
 ```
 
 Then add it to your plugin list and the toolbar configuration:
@@ -110,7 +125,7 @@ import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock';
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ Indent, IndentBlock, ... ],
-		toolbar: [ 'indent', 'outdent', ... ]
+		toolbar: [ 'outdent', 'indent', ... ]
 	} )
 	.then( ... )
 	.catch( ... );
@@ -122,11 +137,25 @@ ClassicEditor
 
 ## Common API
 
+The {@link module:indent/indent~Indent} plugin registers the following components:
+
+* The `'indent'` command.
+
+	Note, this command does not implement any behavior itself. It executes either `indentBlock` (described below) or `indentList`, depending on which of these commands is enabled.
+
+	Read more in the [Indenting lists](#indenting-lists) section above.
+
+* The `'outdent'` command.
+
+	Note, this command does not implement any behavior itself. It executes either `outdentBlock` (described below) or `outdentList`, depending on which of these commands is enabled.
+
+	Read more in the [Indenting lists](#indenting-lists) section above.
+
 The {@link module:indent/indentblock~IndentBlock} plugin registers the following components:
 
 * The {@link module:indent/indentblockcommand~IndentBlockCommand `'indentBlock'`} command.
 
-	You can increase block indentation in which the selection is set by:
+	You can increase the indentation of the block in which the selection is set by:
 
 	```js
 	editor.execute( 'indentBlock' );
@@ -134,7 +163,7 @@ The {@link module:indent/indentblock~IndentBlock} plugin registers the following
 
 * The {@link module:indent/indentblockcommand~IndentBlockCommand `'outdentBlock'`} command.
 
-	You can decrease block indentation in which the selection is set by:
+	You can decrease the indentation of the block in which the selection is set by:
 
 	```js
 	editor.execute( 'outdentBlock' );

+ 1 - 1
packages/ckeditor5-indent/package.json

@@ -1,7 +1,7 @@
 {
   "name": "@ckeditor/ckeditor5-indent",
   "version": "0.0.1",
-  "description": "Indentation feature for CKEditor 5.",
+  "description": "Block indentation feature for CKEditor 5.",
   "keywords": [
     "ckeditor",
     "ckeditor5",

+ 1 - 1
packages/ckeditor5-indent/tests/manual/indent-block-classes.js

@@ -17,8 +17,8 @@ ClassicEditor
 		toolbar: [
 			'heading',
 			'|',
-			'indent',
 			'outdent',
+			'indent',
 			'|',
 			'bulletedList',
 			'numberedList',

+ 1 - 1
packages/ckeditor5-indent/tests/manual/indent-block.js

@@ -18,8 +18,8 @@ ClassicEditor
 		toolbar: [
 			'heading',
 			'|',
-			'indent',
 			'outdent',
+			'indent',
 			'|',
 			'bulletedList',
 			'numberedList',