Procházet zdrojové kódy

Docs: Alignment docs revised. [skip ci]

Anna Tomanek před 7 roky
rodič
revize
40572b426e

+ 3 - 3
packages/ckeditor5-alignment/docs/features/text-alignment.md

@@ -5,7 +5,7 @@ category: features
 
 {@snippet features/build-text-alignment-source}
 
-The {@link module:alignment/alignment~Alignment} feature enables support for text alignment. You can use it to align your content to left, right and center or justify it.
+The {@link module:alignment/alignment~Alignment} feature enables support for text alignment. You can use it to align your content to left, right and center or to justify it.
 
 ## Demo
 
@@ -52,9 +52,9 @@ ClassicEditor
 
 ## Installation
 
-To add this feature to your editor install the [`@ckeditor/ckeditor5-alignment`](https://www.npmjs.com/package/@ckeditor/ckeditor5-alignment) package:
+To add this feature to your editor, install the [`@ckeditor/ckeditor5-alignment`](https://www.npmjs.com/package/@ckeditor/ckeditor5-alignment) package:
 
-```
+```bash
 npm install --save @ckeditor/ckeditor5-alignment
 ```
 

+ 4 - 4
packages/ckeditor5-alignment/lang/contexts.json

@@ -1,7 +1,7 @@
 {
-	"Align left": "Toolbar button tooltip for aligning text to the left.",
-	"Align right": "Toolbar button tooltip for aligning text to the right.",
-	"Align center": "Toolbar button tooltip for aligning text to center.",
-	"Justify": "Toolbar button tooltip for making text justified.",
+	"Align left": "Toolbar button tooltip for aligning the text to the left.",
+	"Align right": "Toolbar button tooltip for aligning the text to the right.",
+	"Align center": "Toolbar button tooltip for aligning the text to center.",
+	"Justify": "Toolbar button tooltip for making the text justified.",
 	"Text alignment": "Dropdown button tooltip for the text alignment feature."
 }

+ 1 - 1
packages/ckeditor5-alignment/src/alignment.js

@@ -80,7 +80,7 @@ export default class Alignment extends Plugin {
  *			.then( ... )
  *			.catch( ... );
  *
- * See a demo of {@glink features/text-alignment#configuring-alignment-options custom alignment options}.
+ * See the demo of {@glink features/text-alignment#configuring-alignment-options custom alignment options}.
  *
  * @member {Array.<String>} module:alignment/alignment~AlignmentConfig#options
  */

+ 5 - 5
packages/ckeditor5-alignment/src/alignmentcommand.js

@@ -41,8 +41,8 @@ export default class AlignmentCommand extends Command {
 
 	/**
 	 * Executes the command. Applies the alignment `value` to the selected blocks.
-	 * If no `value` is passed, is a default one or is equal to currently selected block's alignment attribute,
-	 * it will remove the attribute from the selected blocks.
+	 * If no `value` is passed, the `value` is the default one or it is equal to the currently selected block's alignment attribute,
+	 * the command will remove the attribute from the selected blocks.
 	 *
 	 * @param {Object} [options] Options for the executed command.
 	 * @param {String} [options.value] The value to apply.
@@ -78,7 +78,7 @@ export default class AlignmentCommand extends Command {
 	 * Checks whether a block can have alignment set.
 	 *
 	 * @private
-	 * @param {module:engine/model/element~Element} block A block to be checked.
+	 * @param {module:engine/model/element~Element} block The block to be checked.
 	 * @returns {Boolean}
 	 */
 	_canBeAligned( block ) {
@@ -86,7 +86,7 @@ export default class AlignmentCommand extends Command {
 	}
 }
 
-// Removes alignment attribute from blocks.
+// Removes the alignment attribute from blocks.
 // @private
 function removeAlignmentFromSelection( blocks, writer ) {
 	for ( const block of blocks ) {
@@ -94,7 +94,7 @@ function removeAlignmentFromSelection( blocks, writer ) {
 	}
 }
 
-// Sets alignment attribute on blocks.
+// Sets the alignment attribute on blocks.
 // @private
 function setAlignmentOnSelection( blocks, writer, alignment ) {
 	for ( const block of blocks ) {

+ 1 - 1
packages/ckeditor5-alignment/src/alignmentediting.js

@@ -14,7 +14,7 @@ import { isDefault, isSupported, supportedOptions } from './utils';
 
 /**
  * The alignment editing feature. It introduces the {@link module:alignment/alignmentcommand~AlignmentCommand command} and adds
- * the `alignment` attribute of block elements in the {@link module:engine/model/model~Model model}.
+ * the `alignment` attribute for block elements in the {@link module:engine/model/model~Model model}.
  * @extends module:core/plugin~Plugin
  */
 export default class AlignmentEditing extends Plugin {

+ 2 - 2
packages/ckeditor5-alignment/src/utils.js

@@ -30,10 +30,10 @@ export function isSupported( option ) {
 /**
  * Checks whether alignment is the default one.
  *
- * @param {String} alignment Name of alignment to check.
+ * @param {String} alignment The name of the alignment to check.
  * @returns {Boolean}
  */
 export function isDefault( alignment ) {
-	// Right now only LTR is supported so 'left' value is always the default one.
+	// Right now only LTR is supported so the 'left' value is always the default one.
 	return alignment === 'left';
 }