Răsfoiți Sursa

Docs: Minor warning and some code samples.

Piotrek Koszuliński 7 ani în urmă
părinte
comite
ceb5966c73
1 a modificat fișierele cu 10 adăugiri și 0 ștergeri
  1. 10 0
      packages/ckeditor5-engine/src/dev-utils/model.js

+ 10 - 0
packages/ckeditor5-engine/src/dev-utils/model.js

@@ -43,10 +43,15 @@ import toMap from '@ckeditor/ckeditor5-utils/src/tomap';
 /**
  * Writes the content of a model {@link module:engine/model/document~Document document} to an HTML-like string.
  *
+ *		getData( editor.model ); // -> '<paragraph>Foo![]</paragraph>'
+ *
  * **Note:** A {@link module:engine/model/text~Text text} node that contains attributes will be represented as:
  *
  *		<$text attribute="value">Text data</$text>
  *
+ * **Note:** Using this tool in production-grade code is not recommended. It was designed for development, prototyping,
+ * debugging and testing.
+ *
  * @param {module:engine/model/model~Model} model
  * @param {Object} [options]
  * @param {Boolean} [options.withoutSelection=false] Whether to write the selection. When set to `true`, the selection will
@@ -77,6 +82,8 @@ getData._stringify = stringify;
 /**
  * Sets the content of a model {@link module:engine/model/document~Document document} provided as an HTML-like string.
  *
+ *		setData( editor.model, '<paragraph>Foo![]</paragraph>' );
+ *
  * **Note:** Remember to register elements in the {@link module:engine/model/model~Model#schema model's schema} before
  * trying to use them.
  *
@@ -84,6 +91,9 @@ getData._stringify = stringify;
  *
  *		<$text attribute="value">Text data</$text>
  *
+ * **Note:** Using this tool in production-grade code is not recommended. It was designed for development, prototyping,
+ * debugging and testing.
+ *
  * @param {module:engine/model/model~Model} model
  * @param {String} data HTML-like string to write into the document.
  * @param {Object} options