Explorar el Código

Docs: Word count plugin API docs corrected. [skip ci]

Anna Tomanek hace 6 años
padre
commit
fcf974ec2b

+ 1 - 1
packages/ckeditor5-word-count/src/utils.js

@@ -11,7 +11,7 @@
  * Returns a plain text representation of an element and its children.
  *
  * @param {module:engine/model/element~Element} element
- * @returns {String} Plain text representing model's data
+ * @returns {String} Plain text representing the model's data.
  */
 export function modelElementToPlainText( element ) {
 	if ( element.is( 'text' ) || element.is( 'textProxy' ) ) {

+ 23 - 23
packages/ckeditor5-word-count/src/wordcount.js

@@ -17,13 +17,13 @@ import Template from '@ckeditor/ckeditor5-ui/src/template';
  * The word count plugin.
  *
  * This plugin calculates all words and characters in all {@link module:engine/model/text~Text text nodes} available in the model.
- * It also provides an HTML element, which updates its states whenever the editor's content is changed.
+ * It also provides an HTML element that updates its state whenever the editor content is changed.
  *
- * Firstly model's data are convert to plain text using {@link module:word-count/utils.modelElementToPlainText}.
- * Based on such created plain text there are determined amount of words and characters in your text. Please keep in mind
- * that every block in the editor is separate with a newline character, which is included in the calculation.
+ * The model's data is first converted to plain text using {@link module:word-count/utils.modelElementToPlainText}.
+ * The number of words and characters in your text are determined based on the created plain text. Please keep in mind
+ * that every block in the editor is separated with a newline character, which is included in the calculation.
  *
- * Few examples of how word and character calculation are made:
+ * Here are some examples of how the word and character calculations are made:
  *
  * 		<paragraph>foo</paragraph>
  * 		<paragraph>bar</paragraph>
@@ -69,7 +69,7 @@ export default class WordCount extends Plugin {
 		this.set( 'words', 0 );
 
 		/**
-		 * Label used to display words value in {@link #wordCountContainer output container}
+		 * The label used to display the words value in the {@link #wordCountContainer output container}.
 		 *
 		 * @observable
 		 * @private
@@ -79,7 +79,7 @@ export default class WordCount extends Plugin {
 		this.set( '_wordsLabel' );
 
 		/**
-		 * Label used to display characters value in {@link #wordCountContainer output container}
+		 * The label used to display the characters value in the {@link #wordCountContainer output container}.
 		 *
 		 * @observable
 		 * @private
@@ -89,7 +89,7 @@ export default class WordCount extends Plugin {
 		this.set( '_charactersLabel' );
 
 		/**
-		 * The configuration of this plugins.
+		 * The configuration of this plugin.
 		 *
 		 * @private
 		 * @type {Object}
@@ -97,7 +97,7 @@ export default class WordCount extends Plugin {
 		this._config = editor.config.get( 'wordCount' ) || {};
 
 		/**
-		 * A reference to a {@link module:ui/view~View view object} which contains self-updating HTML container.
+		 * The reference to a {@link module:ui/view~View view object} that contains the self-updating HTML container.
 		 *
 		 * @private
 		 * @readonly
@@ -143,8 +143,8 @@ export default class WordCount extends Plugin {
 	}
 
 	/**
-	 * Creates self-updated HTML element. Repeated executions return the same element.
-	 * Returned element has followed HTML structure:
+	 * Creates a self-updating HTML element. Repeated executions return the same element.
+	 * The returned element has the following HTML structure:
 	 *
 	 * 		<div class="ck ck-word-count">
 	 * 			<div class="ck-word-count__words">Words: 4</div>
@@ -239,12 +239,12 @@ export default class WordCount extends Plugin {
 }
 
 /**
- * Event fired after {@link #words} and {@link #characters} are updated.
+ * An event fired after {@link #words} and {@link #characters} are updated.
  *
  * @event update
  * @param {Object} data
- * @param {Number} data.words number of words in current model
- * @param {Number} data.characters number of characters in current model
+ * @param {Number} data.words The number of words in the current model.
+ * @param {Number} data.characters The number of characters in the current model.
  */
 
 /**
@@ -272,15 +272,15 @@ export default class WordCount extends Plugin {
  */
 
 /**
- * This option allows for hiding the word count. The element obtained through
+ * This option allows for hiding the word counter. The element obtained through
  * {@link module:word-count/wordcount~WordCount#wordCountContainer} will only preserve
- * the characters part. word count is displayed by default when this configuration option is not defined.
+ * the characters part. Word counter is displayed by default when this configuration option is not defined.
  *
  *		const wordCountConfig = {
  *			displayWords: false
  *		}
  *
- * The mentioned configuration will result with the followed container:
+ * The configuration above will result in the following container:
  *
  *		<div class="ck ck-word-count">
  *			<div class="ck-word-count__characters">Characters: 28</div>
@@ -298,7 +298,7 @@ export default class WordCount extends Plugin {
  *			displayCharacters: false
  *		}
  *
- * The mentioned configuration will result in the following container
+ * The configuration above will result in the following container:
  *
  *		<div class="ck ck-word-count">
  *			<div class="ck-word-count__words">Words: 4</div>
@@ -308,9 +308,9 @@ export default class WordCount extends Plugin {
  */
 
 /**
- * This configuration takes a function, which is executed whenever the word-count plugin updates its values.
- * This function is called with one argument, which is an object with `words` and `characters` keys containing
- * a number of detected words and characters in the document.
+ * This configuration takes a function that is executed whenever the word count plugin updates its values.
+ * This function is called with one argument, which is an object with the `words` and `characters` keys containing
+ * the number of detected words and characters in the document.
  *
  *		const wordCountConfig = {
  *			onUpdate: function( stats ) {
@@ -323,8 +323,8 @@ export default class WordCount extends Plugin {
  */
 
 /**
- * This option allows on providing an HTML element where
- * {@link module:word-count/wordcount~WordCount#wordCountContainer word count container} will be appended automatically.
+ * Allows for providing the HTML element that the
+ * {@link module:word-count/wordcount~WordCount#wordCountContainer word count container} will be appended to automatically.
  *
  *		const wordCountConfig = {
  *			container: document.getElementById( 'container-for-word-count' );