bitovi / training

Bitovi's training material
MIT License
19 stars 5 forks source link

How to document components and models. #2

Open m-mujica opened 9 years ago

m-mujica commented 9 years ago

It'd be nice to have a recipe on the documentjs way™ to document Components and Models.

In one of our projects for example, we used the following structure for a Model (it seems @constructor is deprecated, since it's no longer available in the docs).

/**
 * @page Product
 * @group Product.static 0 static
 * @group Product.list 1 List
 * @group Product.instance 2 instance
 *
 * @constructor Product
 * @inherits can.Model
 * @parent models
 * @description
 *  ......
 **/

a component would look like:

/**
 * @constructor ProductItem <product-item>
 * @parent components
 * @group ProductItemViewModel 0 ViewModel
 * @description  ........
**/

The DocumentJS examples uses an interesting approach maybe we can come up with a more detailed example.

marshallswain commented 9 years ago

+1