Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Docs: Made it clear which writer is needed. [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Nov 1, 2018
1 parent fec045d commit a15667a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/conversion/downcast-converters.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ import { cloneDeep } from 'lodash-es';
* @param {Object} config Conversion configuration.
* @param {String} config.model The name of the model element to convert.
* @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
* that takes the model element and view writer as parameters and returns a view container element.
* that takes the model element and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}
* as parameters and returns a view container element.
* @returns {Function} Conversion helper.
*/
export function downcastElementToElement( config ) {
Expand Down Expand Up @@ -123,7 +124,8 @@ export function downcastElementToElement( config ) {
* @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array
* of `String`s with possible values if the model attribute is an enumerable.
* @param {module:engine/view/elementdefinition~ElementDefinition|Function|Object} config.view A view element definition or a function
* that takes the model attribute value and view writer as parameters and returns a view attribute element. If `config.model.values` is
* that takes the model attribute value and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}
* as parameters and returns a view attribute element. If `config.model.values` is
* given, `config.view` should be an object assigning values from `config.model.values` to view element definitions or functions.
* @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
* @returns {Function} Conversion helper.
Expand Down
10 changes: 5 additions & 5 deletions src/view/downcastwriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default class DowncastWriter {
* Creates new {@link module:engine/view/attributeelement~AttributeElement}.
*
* writer.createAttributeElement( 'strong' );
* writer.createAttributeElement( 'strong', { 'alignment': 'center' } );
* writer.createAttributeElement( 'strong', { alignment: 'center' } );
*
* // Make `<a>` element contain other attributes element so the `<a>` element is not broken.
* writer.createAttributeElement( 'a', { href: 'foo.bar' }, { priority: 5 } );
Expand Down Expand Up @@ -179,7 +179,7 @@ export default class DowncastWriter {
* Creates new {@link module:engine/view/containerelement~ContainerElement}.
*
* writer.createContainerElement( 'paragraph' );
* writer.createContainerElement( 'paragraph', { 'alignment': 'center' } );
* writer.createContainerElement( 'paragraph', { alignment: 'center' } );
*
* @param {String} name Name of the element.
* @param {Object} [attributes] Elements attributes.
Expand All @@ -193,7 +193,7 @@ export default class DowncastWriter {
* Creates new {@link module:engine/view/editableelement~EditableElement}.
*
* writer.createEditableElement( 'div' );
* writer.createEditableElement( 'div', { 'alignment': 'center' } );
* writer.createEditableElement( 'div', { alignment: 'center' } );
*
* @param {String} name Name of the element.
* @param {Object} [attributes] Elements attributes.
Expand All @@ -210,7 +210,7 @@ export default class DowncastWriter {
* Creates new {@link module:engine/view/emptyelement~EmptyElement}.
*
* writer.createEmptyElement( 'img' );
* writer.createEmptyElement( 'img', { 'alignment': 'center' } );
* writer.createEmptyElement( 'img', { alignment: 'center' } );
*
* @param {String} name Name of the element.
* @param {Object} [attributes] Elements attributes.
Expand All @@ -224,7 +224,7 @@ export default class DowncastWriter {
* Creates new {@link module:engine/view/uielement~UIElement}.
*
* writer.createUIElement( 'span' );
* writer.createUIElement( 'span', { 'alignment': 'center' } );
* writer.createUIElement( 'span', { alignment: 'center' } );
*
* Custom render function can be provided as third parameter:
*
Expand Down

0 comments on commit a15667a

Please sign in to comment.