Jelajahi Sumber

Docs: Fixes in docs.

Szymon Cofalik 8 tahun lalu
induk
melakukan
85799f1bf9

+ 37 - 35
packages/ckeditor5-engine/src/conversion/conversion.js

@@ -118,8 +118,6 @@ export default class Conversion {
 	 * Sets up converters between the model and the view which convert a model element to a view element (and vice versa).
 	 * For example, model `<paragraph>Foo</paragraph>` is `<p>Foo</p>` in the view.
 	 *
-	 * `definition.model` is a `String` with a model element name to converter from/to.
-	 *
 	 *		// Simple conversion from `paragraph` model element to `<p>` view element (and vice versa).
 	 *		conversion.elementToElement( { model: 'paragraph', view: 'p' } );
 	 *
@@ -179,7 +177,10 @@ export default class Conversion {
 	 *			}
 	 *		} );
 	 *
-	 * @param {~ConverterDefinition} definition Converter definition.
+	 * `definition.model` is a `String` with a model element name to converter from/to.
+	 * See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.
+	 *
+	 * @param {module:engine/conversion/conversion~ConverterDefinition} definition Converter definition.
 	 */
 	elementToElement( definition ) {
 		// Set up downcast converter.
@@ -201,9 +202,6 @@ export default class Conversion {
 	 * Sets up converters between the model and the view which convert a model attribute to a view element (and vice versa).
 	 * For example, model text node with data `"Foo"` and `bold` attribute is `<strong>Foo</strong>` in the view.
 	 *
-	 * `definition.model` parameter specifies what model attribute should be converted from/to. It can be a `{ key, value }` object
-	 * describing attribute key and value to convert or a `String` specifying just attribute key (then `value` is set to `true`).
-	 *
 	 *		// Simple conversion from `bold=true` attribute to `<strong>` view element (and vice versa).
 	 *		conversion.attributeToElement( { model: 'bold', view: 'strong' } );
 	 *
@@ -315,7 +313,11 @@ export default class Conversion {
 	 *			}
 	 *		} );
 	 *
-	 * @param {~ConverterDefinition} definition Converter definition.
+	 * `definition.model` parameter specifies what model attribute should be converted from/to. It can be a `{ key, value }` object
+	 * describing attribute key and value to convert or a `String` specifying just attribute key (then `value` is set to `true`).
+	 * See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.
+	 *
+	 * @param {module:engine/conversion/conversion~ConverterDefinition} definition Converter definition.
 	 */
 	attributeToElement( definition ) {
 		// Set up downcast converter.
@@ -337,32 +339,6 @@ export default class Conversion {
 	 * Sets up converters between the model and the view which convert a model attribute to a view attribute (and vice versa).
 	 * For example, `<image src='foo.jpg'></image>` is converted to `<img src='foo.jpg'></img>` (same attribute key and value).
 	 *
-	 * `definition.model` parameter specifies what model attribute should be converted from/to.
-	 * It can be a `{ key, values, [ name ] }` object or a `String`, which will be treated like `{ key: definition.model }`.
-	 * `key` property is the model attribute key to convert from/to.
-	 * `values` are the possible model attribute values. If `values` is not set, model attribute value will be the same as the
-	 * view attribute value.
-	 * If `name` is set, conversion will be set up only for model elements with the given name.
-	 *
-	 * `definition.view` parameter specifies what view attribute should be converted from/to.
-	 * It can be a `{ key, value, [ name ] }` object or a `String`, which will be treated like `{ key: definition.view }`.
-	 * `key` property is the view attribute key to convert from/to.
-	 * `value` is the view attribute value to convert from/to. If `definition.value` is not set, view attribute value will be
-	 * the same as the model attribute value.
-	 * If `key` is `'class'`, `value` can be a `String` or an array of `String`s.
-	 * If `key` is `'style'`, `value` is an object with key-value pairs.
-	 * In other cases, `value` is a `String`.
-	 * If `name` is set, conversion will be set up only for model elements with the given name.
-	 * If `definition.model.values` is set, `definition.view` is an object which assigns values from `definition.model.values`
-	 * to `{ key, value, [ name ] }` objects.
-	 *
-	 * `definition.upcastAlso` specifies which other matching view elements should be also upcast to given model configuration.
-	 * If `definition.model.values` is set, `definition.upcastAlso` should be an object assigning values from `definition.model.values`
-	 * to {@link module:engine/view/matcher~MatcherPattern}s or arrays of {@link module:engine/view/matcher~MatcherPattern}s.
-	 *
-	 * **Note:** `definition.model` and `definition.view` form should be mirrored, that is the same type of parameters should
-	 * be given in both parameters.
-	 *
 	 *		// Simple conversion from `source` model attribute to `src` view attribute (and vice versa).
 	 *		conversion.attributeToAttribute( { model: 'source', view: 'src' } );
 	 *
@@ -433,7 +409,33 @@ export default class Conversion {
 	 *			}
 	 *		} );
 	 *
-	 * @param {Object} [definition] Converter definition.
+	 * `definition.model` parameter specifies what model attribute should be converted from/to.
+	 * It can be a `{ key, [ values ], [ name ] }` object or a `String`, which will be treated like `{ key: definition.model }`.
+	 * `key` property is the model attribute key to convert from/to.
+	 * `values` are the possible model attribute values. If `values` is not set, model attribute value will be the same as the
+	 * view attribute value.
+	 * If `name` is set, conversion will be set up only for model elements with the given name.
+	 *
+	 * `definition.view` parameter specifies what view attribute should be converted from/to.
+	 * It can be a `{ key, value, [ name ] }` object or a `String`, which will be treated like `{ key: definition.view }`.
+	 * `key` property is the view attribute key to convert from/to.
+	 * `value` is the view attribute value to convert from/to. If `definition.value` is not set, view attribute value will be
+	 * the same as the model attribute value.
+	 * If `key` is `'class'`, `value` can be a `String` or an array of `String`s.
+	 * If `key` is `'style'`, `value` is an object with key-value pairs.
+	 * In other cases, `value` is a `String`.
+	 * If `name` is set, conversion will be set up only for model elements with the given name.
+	 * If `definition.model.values` is set, `definition.view` is an object which assigns values from `definition.model.values`
+	 * to `{ key, value, [ name ] }` objects.
+	 *
+	 * `definition.upcastAlso` specifies which other matching view elements should be also upcast to given model configuration.
+	 * If `definition.model.values` is set, `definition.upcastAlso` should be an object assigning values from `definition.model.values`
+	 * to {@link module:engine/view/matcher~MatcherPattern}s or arrays of {@link module:engine/view/matcher~MatcherPattern}s.
+	 *
+	 * **Note:** `definition.model` and `definition.view` form should be mirrored, that is the same type of parameters should
+	 * be given in both parameters.
+	 *
+	 * @param {Object} definition Converter definition.
 	 * @param {String|Object} definition.model Model attribute to convert from/to.
 	 * @param {String|Object} definition.view View attribute to convert from/to.
 	 * @param {module:engine/view/matcher~MatcherPattern|Array.<module:engine/view/matcher~MatcherPattern>} [definition.upcastAlso]
@@ -517,7 +519,7 @@ function _addToDispatchers( dispatchers, conversionHelper ) {
 // Helper function that creates a joint array out of an item passed in `definition.view` and items passed in
 // `definition.upcastAlso`.
 //
-// @param {~ConverterDefinition} definition
+// @param {module:engine/conversion/conversion~ConverterDefinition} definition
 // @returns {Array} Array containing view definitions.
 function* _getAllUpcastDefinitions( definition ) {
 	if ( definition.model.values ) {

+ 5 - 4
packages/ckeditor5-engine/src/model/markercollection.js

@@ -80,7 +80,8 @@ export default class MarkerCollection {
 	 *
 	 * If `MarkerCollection` already had a marker with given name (or {@link ~Marker marker} was passed), the marker in
 	 * collection is updated and {@link module:engine/model/markercollection~MarkerCollection#event:update} event is fired
-	 * but only if there was a change (marker range or {@link ~Marker#managedUsingOperations} flag has changed.
+	 * but only if there was a change (marker range or {@link module:engine/model/markercollection~Marker#managedUsingOperations}
+	 * flag has changed.
 	 *
 	 * @protected
 	 * @fires module:engine/model/markercollection~MarkerCollection#event:update
@@ -246,7 +247,7 @@ mix( MarkerCollection, EmitterMixin );
  * Name is used to group and identify markers. Names have to be unique, but markers can be grouped by
  * using common prefixes, separated with `:`, for example: `user:john` or `search:3`. That's useful in term of creating
  * namespaces for custom elements (e.g. comments, highlights). You can use this prefixes in
- * {@link module:engine/model/markercollection~MarkerCollection#event:set} listeners to listen on changes in a group of markers.
+ * {@link module:engine/model/markercollection~MarkerCollection#event:update} listeners to listen on changes in a group of markers.
  * For instance: `model.markers.on( 'set:user', callback );` will be called whenever any `user:*` markers changes.
  *
  * There are two types of markers.
@@ -425,7 +426,7 @@ class Marker {
 	 *
 	 * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},
 	 * all event listeners listening to it should be removed. It is best to do it on
-	 * {@link module:engine/model/markercollection~MarkerCollection#event:remove MarkerCollection remove event}.
+	 * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.
 	 *
 	 * @see module:engine/model/liverange~LiveRange#event:change:range
 	 * @event change:range
@@ -439,7 +440,7 @@ class Marker {
 	 *
 	 * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},
 	 * all event listeners listening to it should be removed. It is best to do it on
-	 * {@link module:engine/model/markercollection~MarkerCollection#event:remove MarkerCollection remove event}.
+	 * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.
 	 *
 	 * @see module:engine/model/liverange~LiveRange#event:change:content
 	 * @event change:content