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

Docs: Improve highlight documentation.

Maciej Gołaszewski 8 лет назад
Родитель
Сommit
20609a4735

+ 5 - 0
packages/ckeditor5-highlight/src/highlightcommand.js

@@ -14,6 +14,11 @@ import Range from '@ckeditor/ckeditor5-engine/src/model/range';
  * The highlight command. It is used by the {@link module:highlight/highlightediting~HighlightEditing highlight feature}
  * to apply text highlighting.
  *
+ *		editor.execute( 'highlight', { value: 'greenMarker' } );
+ *
+ * **Note**: Executing the command without the value removes the attribute from the model. If selection is collapsed inside
+ * text with highlight attribute the whole range with that attribute will be removed from the model.
+ *
  * @extends module:core/command~Command
  */
 export default class HighlightCommand extends Command {

+ 4 - 1
packages/ckeditor5-highlight/src/highlightediting.js

@@ -13,7 +13,10 @@ import { attributeToElement } from '@ckeditor/ckeditor5-engine/src/conversion/tw
 import HighlightCommand from './highlightcommand';
 
 /**
- * The highlight editing feature. It introduces `highlight` command which allow to highlight selected text with defined 'marker' or 'pen'.
+ * The highlight editing feature. It introduces {@link module:highlight/highlightcommand~HighlightCommand command } and the `highlight`
+ * attribute in the {@link module:engine/model/model~Model model} which renders in the {@link module:engine/view/view view}
+ * as a `<mark>` element with a class attribute (`<span class="marker-green">...</span>`) depending
+ * on the {@link module:highlight/highlight~HighlightConfig configuration}.
  *
  * @extends module:core/plugin~Plugin
  */

+ 8 - 1
packages/ckeditor5-highlight/src/highlightui.js

@@ -23,7 +23,14 @@ import { createDropdown, addToolbarToDropdown } from '@ckeditor/ckeditor5-ui/src
 import './../theme/highlight.css';
 
 /**
- * The default Highlight UI plugin.
+ * The default Highlight UI plugin. It introduces the `'highlightDropdown'` drop-down, `'removeHighlight'` and `'highlight:*'` buttons.
+ *
+ * The default configuration provides below buttons:
+ * * `'highlight:marker'`
+ * * `'highlight:pinkMarker'`
+ * * `'highlight:greenMarker'`
+ * * `'highlight:redPen'`
+ * * `'highlight:bluePen'`
  *
  * @extends module:core/plugin~Plugin
  */