Skip to content

Commit

Permalink
Merge pull request #13 from enyojs/ENYO-1521-rs
Browse files Browse the repository at this point in the history
ENYO-1521 Updated way modules are documented

Reviewed-By: Ryan Duffy (ryan.duffy@lge.com)
Integrated-By: Ryan Duffy (ryan.duffy@lge.com)
  • Loading branch information
ryanjduffy committed Jun 18, 2015
2 parents 50eab13 + 0dc278a commit 1725a4d
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 99 deletions.
34 changes: 16 additions & 18 deletions lib/Canvas.js
@@ -1,32 +1,30 @@
/**
* Contains the declaration for the {@link enyo.Canvas} kind.
* Contains the declaration for the {@link module:canvas/Canvas~Canvas} kind.
* @module canvas/Canvas
*/

var
kind = require('enyo/kind');

var
CanvasControl = require('./CanvasControl'),
Control = require('./Control'),
UiComponent = require('enyo/UiComponent'),
Control = require('enyo/Control');

/**
* {@link enyo.Canvas} is a control that generates a <canvas> HTML tag.
* It may contain other canvas components derived not from {@link enyo.Control},
* but from {@link enyo.canvas.Control}. These components are not true controls
* {@link module:canvas/Canvas~Canvas} is a control that generates a <canvas> HTML tag.
* It may contain other canvas components derived not from {@link module:enyo/Control~Control},
* but from {@link module:canvas/Control~Control}. These components are not true controls
* in the sense of being DOM elements; they are, instead, shapes drawn into the
* canvas.
*
* @ui
* @namespace enyo
* @class enyo.Canvas
* @extends enyo.Control
* @definedby module:canvas/Canvas
* @class Canvas
* @extends module:enyo/Control~Control
* @public
*/
module.exports = kind(
/** @lends enyo.Canvas.prototype */ {
/** @lends module:canvas/Canvas~Canvas.prototype */ {

/**
* @private
Expand All @@ -46,7 +44,7 @@ module.exports = kind(
/**
* Hash containing the default height `(500)` and width `(500)` for the canvas.
*
* @see {@link enyo.Control.attributes}
* @see {@link module:enyo/Control~Control.attributes}
* @public
*/
attributes: {
Expand All @@ -59,7 +57,7 @@ module.exports = kind(
/**
* @private
*/
defaultKind: CanvasControl,
defaultKind: Control,

/**
* Canvas tags do not have any content.
Expand All @@ -84,10 +82,10 @@ module.exports = kind(
},

/*
* The `addChild()` method of {@link enyo.Control} assumes that the child
* being added is an instance of `enyo.Control`. Because CanvasControls are
* The `addChild()` method of {@link module:enyo/Control~Control} assumes that the child
* being added is an instance of `enyo.Control`. Because Controls are
* not instances of `enyo.Control`, we instead call the `addChild()` method
* on {@link enyo.UiComponent}, the superkind of `enyo.Control`.
* on {@link module:enyo/UiComponent~UiComponent}, the superkind of `enyo.Control`.
*
* @private
*/
Expand All @@ -96,10 +94,10 @@ module.exports = kind(
},

/*
* The `removeChild()` method of {@link enyo.Control} assumes that the child
* being removed is an instance of `enyo.Control`. Because CanvasControls are
* The `removeChild()` method of {@link module:enyo/Control~Control} assumes that the child
* being removed is an instance of `enyo.Control`. Because Controls are
* not instances of `enyo.Control`, we instead call the `removeChild()` method
* on {@link enyo.UiComponent}, the superkind of `enyo.Control`.
* on {@link module:enyo/UiComponent~UiComponent}, the superkind of `enyo.Control`.
*
* @private
*/
Expand Down
16 changes: 7 additions & 9 deletions lib/Circle.js
@@ -1,5 +1,5 @@
/**
* Contains the declaration for the {@link enyo.canvas.Circle} kind.
* Contains the declaration for the {@link module:canvas/Circle~Circle} kind.
* @module canvas/Circle
*/

Expand All @@ -10,18 +10,16 @@ var
Shape = require('./Shape');

/**
* {@link enyo.canvas.Circle} is a canvas control that draws a circle fitting
* the parameters specified by the [bounds]{@link enyo.canvas.Control#bounds}
* property on {@link enyo.canvas.Control}.
* {@link module:canvas/Circle~Circle} is a canvas control that draws a circle fitting
* the parameters specified by the [bounds]{@link module:canvas/Control~Control#bounds}
* property on {@link module:canvas/Control~Control}.
*
* @namespace enyo.canvas
* @class enyo.canvas.Circle
* @extends enyo.canvas.Shape
* @definedby module:canvas/Circle
* @class Circle
* @extends module:canvas/Shape~Shape
* @public
*/
module.exports = kind(
/** @lends enyo.canvas.Circle.prototype */ {
/** @lends module:canvas/Circle~Circle.prototype */ {

/**
* @private
Expand Down
28 changes: 13 additions & 15 deletions lib/CanvasControl.js → lib/Control.js
@@ -1,6 +1,6 @@
/**
* Contains the declaration for the {@link enyo.canvas.CanvasControl} kind.
* @module canvas/CanvasControl
* Contains the declaration for the {@link module:canvas/Control~Control} kind.
* @module canvas/Control
*/

var
Expand All @@ -13,31 +13,29 @@ var
/**
* Fires when this control is to be rendered.
*
* @event enyo.canvas.Control#event:onRender
* @event module:canvas/Control~Control#event:onRender
* @param {Context} context - The active canvas context.
* @public
*/

/**
* {@link enyo.canvas.Control} is the base kind for items that live inside an
* {@link enyo.Canvas} control.
* {@link module:canvas/Control~Control} is the base kind for items that live inside an
* {@link module:canvas/Canvas~Canvas} control.
*
* If you're using this kind directly, you may implement an `onRender` event
* handler in the owner to handle drawing into the canvas.
*
* If you're deriving a new kind based on this one, override the
* [renderSelf()]{@link enyo.canvas.Control#renderSelf} method and use that for
* [renderSelf()]{@link module:canvas/Control~Control#renderSelf} method and use that for
* your drawing code.
*
*
* @namespace enyo.canvas
* @class enyo.canvas.Control
* @extends enyo.UiComponent
* @definedby module:canvas/CanvasControl
* @class Control
* @extends module:enyo/UiComponent~UiComponent
* @public
*/
var CanvasControl = module.exports = kind(
/** @lends enyo.canvas.Control.prototype */ {
var Control = module.exports = kind(
/** @lends module:canvas/Control~Control.prototype */ {

/**
* @private
Expand All @@ -50,7 +48,7 @@ var CanvasControl = module.exports = kind(
kind: UiComponent,

/**
* @lends enyo.canvas.Control.prototype
* @lends module:canvas/Control~Control.prototype
* @private
*/
published: {
Expand Down Expand Up @@ -91,7 +89,7 @@ var CanvasControl = module.exports = kind(
},

/**
* @fires enyo.canvas.Control#event:onRender
* @fires module:canvas/Control~Control#event:onRender
* @protected
*/
renderSelf: function (context) {
Expand Down Expand Up @@ -119,4 +117,4 @@ var CanvasControl = module.exports = kind(
}
});

CanvasControl.prototype.defaultKind = CanvasControl;
Control.prototype.defaultKind = Control;
20 changes: 9 additions & 11 deletions lib/Image.js
@@ -1,27 +1,25 @@
/**
* Contains the declaration for the {@link enyo.canvas.Image} kind.
* Contains the declaration for the {@link module:canvas/Image~Image} kind.
* @module canvas/Image
*/

var
kind = require('enyo/kind');

var
CanvasControl = require('./CanvasControl');
Control = require('./Control');

/**
* {@link enyo.canvas.Image} is a canvas control that draws an image, stretched
* to fit the rectangle specified by the [bounds]{@link enyo.canvas.Image#bounds}
* {@link module:canvas/Image~Image} is a canvas control that draws an image, stretched
* to fit the rectangle specified by the [bounds]{@link module:canvas/Image~Image#bounds}
* property.
*
* @namespace enyo.canvas
* @class enyo.canvas.Image
* @extends enyo.canvas.Control
* @definedby module:canvas/Image
* @class Image
* @extends module:canvas/Control~Control
* @public
*/
module.exports = kind(
/** @lends enyo.canvas.Image.prototype */ {
/** @lends module:canvas/Image~Image.prototype */ {

/**
* @private
Expand All @@ -31,10 +29,10 @@ module.exports = kind(
/**
* @private
*/
kind: CanvasControl,
kind: Control,

/**
* @lends enyo.canvas.Image.prototype
* @lends module:canvas/Image~Image.prototype
* @private
*/
published: {
Expand Down
20 changes: 9 additions & 11 deletions lib/Line.js
@@ -1,5 +1,5 @@
/**
* Contains the declaration for the {@link enyo.canvas.Line} kind.
* Contains the declaration for the {@link module:canvas/Line~Line} kind.
* @module canvas/Line
*/

Expand All @@ -12,7 +12,7 @@ var
/**
* Used to set parameters for drawing a line.
*
* @typedef {Object} enyo.canvas.Line~Bounds
* @typedef {Object} module:canvas/Line~Line~Bounds
* @property {String} Style - Stroke style.
* @property {Number} width - Line width.
* @property {String} cap - Line cap.
Expand All @@ -24,18 +24,16 @@ var
*/

/**
* {@link enyo.canvas.Line} is a canvas control that draws a line according to
* the parameters specified by the [bounds]{@link enyo.canvas.Line#bounds}
* {@link module:canvas/Line~Line} is a canvas control that draws a line according to
* the parameters specified by the [bounds]{@link module:canvas/Line~Line#bounds}
* property.
*
* @namespace enyo.canvas
* @class enyo.canvas.Line
* @extends enyo.canvas.Shape
* @definedby module:canvas/Line
* @class Line
* @extends module:canvas/Shape~Shape
* @public
*/
module.exports = kind(
/** @lends enyo.canvas.Line.prototype */ {
/** @lends module:canvas/Line~Line.prototype */ {

/**
* @private
Expand All @@ -48,14 +46,14 @@ module.exports = kind(
kind: Shape,

/**
* @lends enyo.canvas.Line.prototype
* @lends module:canvas/Line~Line.prototype
* @private
*/
published: {
/**
* Bounds of the line.
*
* @type {enyo.canvas.Line~Bounds}
* @type {module:canvas/Line~Line~Bounds}
* @default null
* @public
*/
Expand Down
16 changes: 7 additions & 9 deletions lib/Rectangle.js
@@ -1,5 +1,5 @@
/**
* Contains the declaration for the {@link enyo.canvas.Rectangle} kind.
* Contains the declaration for the {@link module:canvas/Rectangle~Rectangle} kind.
* @module canvas/Rectangle
*/

Expand All @@ -10,18 +10,16 @@ var
Shape = require('./Shape');

/**
* {@link enyo.canvas.Rectangle} is a canvas control that draws a rectangle
* fitting the parameters specified by the [bounds]{@link enyo.canvas.Control#bounds}
* {@link module:canvas/Rectangle~Rectangle} is a canvas control that draws a rectangle
* fitting the parameters specified by the [bounds]{@link module:canvas/Control~Control#bounds}
* property.
*
* @namespace enyo.canvas
* @class enyo.canvas.Rectangle
* @extends enyo.canvas.Shape
* @definedby module:canvas/Rectangle
* @class Rectangle
* @extends module:canvas/Shape~Shape
* @public
*/
module.exports = kind(
/** @lends enyo.canvas.Rectange.prototype */ {
/** @lends module:canvas/Rectange~Rectange.prototype */ {

/**
* @private
Expand All @@ -34,7 +32,7 @@ module.exports = kind(
kind: Shape,

/**
* @lends enyo.canvas.Rectangle.prototype
* @lends module:canvas/Rectangle~Rectangle.prototype
* @private
*/
published: {
Expand Down

0 comments on commit 1725a4d

Please sign in to comment.