8
0
Просмотр исходного кода

Docs corrections for the headings feature.

Anna Tomanek 9 лет назад
Родитель
Сommit
d5940fd462

+ 1 - 1
packages/ckeditor5-heading/CONTRIBUTING.md

@@ -1,4 +1,4 @@
 Contributing
 Contributing
 ========================================
 ========================================
 
 
-Information about contributing can be found at the following page: <https://github.com/ckeditor/ckeditor5/blob/master/CONTRIBUTING.md>.
+Information about contributing can be found on the following page: <https://github.com/ckeditor/ckeditor5/blob/master/CONTRIBUTING.md>.

+ 1 - 1
packages/ckeditor5-heading/LICENSE.md

@@ -1,7 +1,7 @@
 Software License Agreement
 Software License Agreement
 ==========================
 ==========================
 
 
-**CKEditor5 Headings Feature** – https://github.com/ckeditor/ckeditor5-headings <br>
+**CKEditor 5 Headings Feature** – https://github.com/ckeditor/ckeditor5-headings <br>
 Copyright (c) 2003-2016, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
 Copyright (c) 2003-2016, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
 
 
 Licensed under the terms of any of the following licenses at your choice:
 Licensed under the terms of any of the following licenses at your choice:

+ 2 - 2
packages/ckeditor5-heading/README.md

@@ -1,9 +1,9 @@
-CKEditor5 Headings Feature
+CKEditor 5 Headings Feature
 ========================================
 ========================================
 
 
 [![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-headings/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-headings#info=devDependencies)
 [![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-headings/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-headings#info=devDependencies)
 
 
- More information about the project can be found at the following url: <https://github.com/ckeditor/ckeditor5-headings>.
+The headings feature for CKEditor 5. More information about the project can be found at the following URL: <https://github.com/ckeditor/ckeditor5-headings>.
 
 
 ## License
 ## License
 
 

+ 2 - 1
packages/ckeditor5-heading/src/headings.js

@@ -11,7 +11,8 @@ import ListDropdownView from '../ui/dropdown/list/listdropdownview.js';
 import Collection from '../utils/collection.js';
 import Collection from '../utils/collection.js';
 
 
 /**
 /**
- * The headings feature. Introduces a "headings" drop-down and a command which allow switching paragraphs into headings.
+ * The headings feature. It introduces the headings drop-down list and the command that allows
+ * to convert paragraphs into headings.
  *
  *
  * @memberOf headings
  * @memberOf headings
  * @extends ckeditor5.Feature
  * @extends ckeditor5.Feature

+ 19 - 19
packages/ckeditor5-heading/src/headingscommand.js

@@ -7,23 +7,23 @@ import Command from '../command/command.js';
 import RootElement from '../engine/model/rootelement.js';
 import RootElement from '../engine/model/rootelement.js';
 
 
 /**
 /**
- * Headings command. Used by the {@link headings.Headings headings feature}.
+ * The headings command. It is used by the {@link headings.Headings headings feature}.
  *
  *
  * @memberOf headings
  * @memberOf headings
  * @extends ckeditor5.command.Command
  * @extends ckeditor5.command.Command
  */
  */
 export default class HeadingsCommand extends Command {
 export default class HeadingsCommand extends Command {
 	/**
 	/**
-	 * Creates instance of the command.
+	 * Creates an instance of the command.
 	 *
 	 *
 	 * @param {ckeditor5.editor.Editor} editor Editor instance.
 	 * @param {ckeditor5.editor.Editor} editor Editor instance.
-	 * @param {Array.<headings.HeadingsFormat>} formats Headings formats to be used by command's instance.
+	 * @param {Array.<headings.HeadingsFormat>} formats Heading formats to be used by the command instance.
 	 */
 	 */
 	constructor( editor, formats ) {
 	constructor( editor, formats ) {
 		super( editor );
 		super( editor );
 
 
 		/**
 		/**
-		 * Headings formats used by this command.
+		 * Heading formats used by this command.
 		 *
 		 *
 		 * @readonly
 		 * @readonly
 		 * @member {headings.HeadingsFormat} headings.HeadingsCommand#formats
 		 * @member {headings.HeadingsFormat} headings.HeadingsCommand#formats
@@ -31,7 +31,7 @@ export default class HeadingsCommand extends Command {
 		this.formats = formats;
 		this.formats = formats;
 
 
 		/**
 		/**
-		 * Currently selected headings format.
+		 * The currently selected heading format.
 		 *
 		 *
 		 * @readonly
 		 * @readonly
 		 * @observable
 		 * @observable
@@ -39,7 +39,7 @@ export default class HeadingsCommand extends Command {
 		 */
 		 */
 		this.set( 'value', this.defaultFormat );
 		this.set( 'value', this.defaultFormat );
 
 
-		// Listen on selection change and set current command's format to format in current selection.
+		// Listen on selection change and set current command's format to format in the current selection.
 		this.listenTo( editor.document.selection, 'change', () => {
 		this.listenTo( editor.document.selection, 'change', () => {
 			const position = editor.document.selection.getFirstPosition();
 			const position = editor.document.selection.getFirstPosition();
 			const block = findTopmostBlock( position );
 			const block = findTopmostBlock( position );
@@ -66,9 +66,9 @@ export default class HeadingsCommand extends Command {
 	/**
 	/**
 	 * Executes the command if it is enabled.
 	 * Executes the command if it is enabled.
 	 *
 	 *
-	 * @param {String} [formatId] Identifier of the headings format that should be applied. It should be one of the
-	 * {@link headings.HeadingsFormat} provided to the command's constructor. If this parameter is not provided, value
-	 * from {@link headings.HeadingsCommand#defaultFormat defaultFormat} will be used.
+	 * @param {String} [formatId] The identifier of the heading format that should be applied. It should be one of the
+	 * {@link headings.HeadingsFormat heading formats} provided to the command constructor. If this parameter is not provided,
+	 * the value from {@link headings.HeadingsCommand#defaultFormat defaultFormat} will be used.
 	 */
 	 */
 	_doExecute( formatId = this.defaultFormat.id ) {
 	_doExecute( formatId = this.defaultFormat.id ) {
 		// TODO: What should happen if format is not found?
 		// TODO: What should happen if format is not found?
@@ -127,7 +127,7 @@ export default class HeadingsCommand extends Command {
 	}
 	}
 
 
 	/**
 	/**
-	 * Returns format by given id.
+	 * Returns the format by a given ID.
 	 *
 	 *
 	 * @private
 	 * @private
 	 * @param {String} id
 	 * @param {String} id
@@ -138,15 +138,15 @@ export default class HeadingsCommand extends Command {
 	}
 	}
 }
 }
 
 
-// Looks for topmost element from position parent to element placed in root.
+// Looks for the topmost element in the position's ancestor (up to an element in the root).
 //
 //
-// NOTE: This method does not checks schema directly - assumes that only block elements can be placed directly inside
-// root.
+// NOTE: This method does not check the schema directly &mdash; it assumes that only block elements can be placed directly inside
+// the root.
 //
 //
 // @private
 // @private
 // @param {engine.model.Position} position
 // @param {engine.model.Position} position
-// @param {Boolean} [nodeAfter=true] When position is placed inside root element this will determine if element before
-// or after given position will be returned.
+// @param {Boolean} [nodeAfter=true] When the position is placed inside the root element, this will determine if the element before
+// or after a given position will be returned.
 // @returns {engine.model.Element}
 // @returns {engine.model.Element}
 function findTopmostBlock( position, nodeAfter = true ) {
 function findTopmostBlock( position, nodeAfter = true ) {
 	let parent = position.parent;
 	let parent = position.parent;
@@ -164,10 +164,10 @@ function findTopmostBlock( position, nodeAfter = true ) {
 }
 }
 
 
 /**
 /**
- * Headings format descriptor.
+ * Heading format descriptor.
  *
  *
  * @typedef {Object} headings.HeadingsFormat
  * @typedef {Object} headings.HeadingsFormat
- * @property {String} id Format identifier, it will be used as element's name in the model.
- * @property {String} viewElement Name of the view element that will be used to represent model element in the view.
- * @property {String} label Display name of the format.
+ * @property {String} id Format identifier. It will be used as the element's name in the model.
+ * @property {String} viewElement The name of the view element that will be used to represent the model element in the view.
+ * @property {String} label The display name of the format.
  */
  */

+ 2 - 2
packages/ckeditor5-heading/src/headingsengine.js

@@ -17,8 +17,8 @@ const formats = [
 ];
 ];
 
 
 /**
 /**
- * The headings feature. Handles switching between block formats - different headings and paragraph.
- * This class represents the engine part of the Headings feature.
+ * The headings feature. It handles switching between block formats &mdash; different headings and paragraph.
+ * This class represents the engine part of the headings feature.
  *
  *
  * @memberOf headings
  * @memberOf headings
  * @extends ckeditor5.Feature
  * @extends ckeditor5.Feature