浏览代码

Docs: Add more explanatory descriptions.

Maciej Gołaszewski 7 年之前
父节点
当前提交
fa745093c5

+ 1 - 1
packages/ckeditor5-font/docs/features/font-family.md

@@ -5,7 +5,7 @@ category: features
 
 {@snippet features/build-font-family-source}
 
-The {@link module:font/fontfamily~FontFamily} feature enables support for setting font family.
+The {@link module:font/fontfamily~FontFamily} feature enables support for setting font family. This feature allows to control size of a text by inline `<span>` elements with a `font-family` CSS set in style attribute.
 
 ## Demo
 

+ 25 - 1
packages/ckeditor5-font/docs/features/font-size.md

@@ -5,7 +5,7 @@ category: features
 
 {@snippet features/build-font-size-source}
 
-The {@link module:font/fontsize~FontSize} feature enables support for setting font size.
+The {@link module:font/fontsize~FontSize} feature enables support for setting font size. This feature allows to control size of a text by inline `<span>` elements that have set either class or `font-size` CSS set in style attribute.
 
 ## Demo
 
@@ -33,6 +33,30 @@ Each size is represented in the view as a `<span>` element with the `text-*` cla
 <span class="text-tiny">...</span>
 ```
 
+The CSS definition for those CSS classes must be included:
+- on the web page's CSS stylesheet that the editor is included and 
+- on the web page's CSS stylesheet that renders edited content. 
+
+The examples defines below CSS:
+
+```css
+.text-tiny {
+	font-size: 0.7em;
+}
+
+.text-small {
+	font-size: 0.85em;
+}
+
+.text-big {
+	font-size: 1.4em;
+}
+
+.text-huge {
+	font-size: 1.8em;
+}
+```
+
 An example of the editor that supports only two font sizes:
 
 ```js

+ 4 - 2
packages/ckeditor5-font/src/font.js

@@ -13,9 +13,11 @@ import FontFamily from './fontfamily';
 import FontSize from './fontsize';
 
 /**
- * The Font plugin.
+ * A plugin that includes additional font features. It represents set of features that manipulates visual representation of text.
  *
- * It requires {@link module:font/fontsize~FontSize} and {@link module:font/fontfamily~FontFamily} plugins.
+ * This plugin enables:
+ * * {@link module:font/fontsize~FontSize}
+ * * {@link module:font/fontfamily~FontFamily} plugins.
  *
  * Read more about the feature in the {@glink api/font font package} page.
  *

+ 0 - 1
packages/ckeditor5-font/src/fontcommand.js

@@ -59,7 +59,6 @@ export default class FontCommand extends Command {
 	 * @protected
 	 * @param {Object} [options] Options for the executed command.
 	 * @param {String} [options.value] a value to apply.
-	 *
 	 * @fires execute
 	 */
 	execute( options = {} ) {

+ 1 - 1
packages/ckeditor5-font/src/fontfamily.js

@@ -12,7 +12,7 @@ import FontFamilyEditing from './fontfamily/fontfamilyediting';
 import FontFamilyUI from './fontfamily/fontfamilyui';
 
 /**
- * The Font family plugin.
+ * The font family plugin.
  *
  * It requires {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} and
  * {@link module:font/fontfamily/fontfamilyui~FontFamilyUI} plugins.

+ 3 - 3
packages/ckeditor5-font/src/fontfamily/fontfamilycommand.js

@@ -13,13 +13,13 @@ import FontCommand from '../fontcommand';
  * The font family command. It is used by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing}
  * to apply font family.
  *
+ *		editor.execute( 'fontFamily', { value: 'Arial' } );
+ *
  * @extends module:core/command~Command
  */
 export default class FontFamilyCommand extends FontCommand {
 	/**
-	 * Creates an instance of the command.
-	 *
-	 * @param {module:core/editor/editor~Editor} editor Editor instance.
+	 * @inheritDoc
 	 */
 	constructor( editor ) {
 		super( editor, 'fontFamily' );

+ 2 - 1
packages/ckeditor5-font/src/fontfamily/fontfamilyediting.js

@@ -16,7 +16,8 @@ import { normalizeOptions } from './utils';
 const FONT_FAMILY = 'fontFamily';
 
 /**
- * The Font Family Editing feature.
+ * The font family editing feature. It introduces the `'fontFamily'` command and introduces `fontFamily` attribute in the model
+ * which renders to the view as a `<span>` element with a `font-family` style attribute.
  *
  * @extends module:core/plugin~Plugin
  */

+ 2 - 0
packages/ckeditor5-font/src/fontfamily/fontfamilyui.js

@@ -18,6 +18,8 @@ import { normalizeOptions } from './utils';
 import fontFamilyIcon from '../../theme/icons/font-family.svg';
 
 /**
+ * The font family UI plugin. It introduces the `'fontFamily'` drop-down.
+ *
  * @extends module:core/plugin~Plugin
  */
 export default class FontFamilyUI extends Plugin {

+ 1 - 1
packages/ckeditor5-font/src/fontsize.js

@@ -12,7 +12,7 @@ import FontSizeEditing from './fontsize/fontsizeediting';
 import FontSizeUI from './fontsize/fontsizeui';
 
 /**
- * The Font size plugin.
+ * The font size plugin.
  *
  * It requires {@link module:font/fontsize/fontsizeediting~FontSizeEditing} and
  * {@link module:font/fontsize/fontsizeui~FontSizeUI} plugins.

+ 3 - 3
packages/ckeditor5-font/src/fontsize/fontsizecommand.js

@@ -13,13 +13,13 @@ import FontCommand from '../fontcommand';
  * The font size command. It is used by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing}
  * to apply font size.
  *
+ *		editor.execute( 'fontSize', { value: 'small' } );
+ *
  * @extends module:core/command~Command
  */
 export default class FontSizeCommand extends FontCommand {
 	/**
-	 * Creates an instance of the command.
-	 *
-	 * @param {module:core/editor/editor~Editor} editor Editor instance.
+	 * @inheritDoc
 	 */
 	constructor( editor ) {
 		super( editor, 'fontSize' );

+ 2 - 1
packages/ckeditor5-font/src/fontsize/fontsizeediting.js

@@ -16,7 +16,8 @@ import { normalizeOptions } from './utils';
 const FONT_SIZE = 'fontSize';
 
 /**
- * The Font Size Editing feature.
+ * The font size editing feature. It introduces the `'fontSize'` command and introduces `fontSize` attribute in the model which renders
+ * to the view depending on configuration as a `<span>` element with either a `font-size` style attribute or a class attribute.
  *
  * @extends module:core/plugin~Plugin
  */

+ 2 - 0
packages/ckeditor5-font/src/fontsize/fontsizeui.js

@@ -20,6 +20,8 @@ import fontSizeIcon from '../../theme/icons/font-size.svg';
 import '../../theme/fontsize.css';
 
 /**
+ * The font family UI plugin. It introduces the `'fontSize'` drop-down.
+ *
  * @extends module:core/plugin~Plugin
  */
 export default class FontSizeUI extends Plugin {