Parcourir la source

Merge pull request #13 from ckeditor/t/12

Added docs to Bold and Italic features.
Piotrek Koszuliński il y a 9 ans
Parent
commit
7df2675209

+ 14 - 0
packages/ckeditor5-basic-styles/src/bold.js

@@ -9,11 +9,25 @@ import ButtonController from '../ui/button/button.js';
 import ButtonView from '../ui/button/buttonview.js';
 import Model from '../ui/model.js';
 
+/**
+ * The Bold feature. It introduces the `bold` button and <kbd>CTRL+B</kbd> keystroke.
+ *
+ * It uses the {@link basic-styles.BoldEngine Bold engine feature}.
+ *
+ * @memberOf basic-styles
+ * @extends ckeditor5.Feature
+ */
 export default class Bold extends Feature {
+	/**
+	 * @inheritDoc
+	 */
 	static get requires() {
 		return [ BoldEngine ];
 	}
 
+	/**
+	 * @inheritDoc
+	 */
 	init() {
 		const editor = this.editor;
 		const t = editor.t;

+ 12 - 0
packages/ckeditor5-basic-styles/src/boldengine.js

@@ -10,7 +10,19 @@ import AttributeCommand from '../command/attributecommand.js';
 
 const BOLD = 'bold';
 
+/**
+ * Bold engine feature.
+ *
+ * It registers `bold` command and introduces `bold` attribute in the model, which renders to the view
+ * as an `<strong>` element.
+ *
+ * @memberOf basic-styles
+ * @extends ckeditor5.Feature
+ */
 export default class BoldEngine extends Feature {
+	/**
+	 * @inheritDoc
+	 */
 	init() {
 		const editor = this.editor;
 		const data = editor.data;

+ 14 - 0
packages/ckeditor5-basic-styles/src/italic.js

@@ -9,11 +9,25 @@ import ButtonController from '../ui/button/button.js';
 import ButtonView from '../ui/button/buttonview.js';
 import Model from '../ui/model.js';
 
+/**
+ * The Italic feature. It introduces the `italic` button and <kbd>CTRL+I</kbd> keystroke.
+ *
+ * It uses the {@link basic-styles.ItalicEngine Italic engine feature}.
+ *
+ * @memberOf basic-styles
+ * @extends ckeditor5.Feature
+ */
 export default class Italic extends Feature {
+	/**
+	 * @inheritDoc
+	 */
 	static get requires() {
 		return [ ItalicEngine ];
 	}
 
+	/**
+	 * @inheritDoc
+	 */
 	init() {
 		const editor = this.editor;
 		const t = editor.t;

+ 12 - 0
packages/ckeditor5-basic-styles/src/italicengine.js

@@ -10,7 +10,19 @@ import AttributeCommand from '../command/attributecommand.js';
 
 const ITALIC = 'italic';
 
+/**
+ * Italic engine feature.
+ *
+ * It registers the `italic` command and introduces the `italic` attribute in the model, which renders to the view
+ * as an`<em>` element.
+ *
+ * @memberOf basic-styles
+ * @extends ckeditor5.Feature
+ */
 export default class ItalicEngine extends Feature {
+	/**
+	 * @inheritDoc
+	 */
 	init() {
 		const editor = this.editor;
 		const data = editor.data;