Hi, I started working on a fairly big project with kernel.js and I want to implement automatic documentation ASAP.
I was wondering if any of you have any good practices on using YUIdoc in combination with Kernel.js?
The problem that I have is that I would like to "set" modules as @module but then I don't know what to set hub, so I went with hub - @module, module - @submodule, but then documentation doesn't get "rendered" correctly.
And additional question - I implemented whole logic over multiple files - so I was wondering if this is correct "structure".
For example:
---
kernel.js (main file)
---
/**
* Dont know what to write here
*/
Kernel.extend(Kernel, {
doAjax: function(config) {
},
doREST: function(config) {
}
});
$(document).ready(function() {
Kernel.start([
// starting all modules
]);
});
---
kernel.main.hub.js (hub)
---
/**
* Main hub
* @module main
*/
Kernel.hub.define('main', {
// Expose REST capabilities to hub
request: function(config) {
Kernel.doREST(config);
},
someFunction: function(category) {
var self = this;
/**
* Sth happened
* @event event-name
* @param {Object} [data] Event data payload
*/
self.broadcast('event-name', data);
}
});
---
kernel.main.modules.js (modules)
---
/**
* Some module
* @module main
* @submodule doSth
*/
Kernel.module.define('doSth', {
/**
* Initialize
* @class init
* @extends doSth
*/
init: function() {
},
/**
* Another function
* @class anotherFunction
* @extends doSth
*/
anotherFunction: function(picture) {
}
});
// Module registration
Kernel.register([
{id: 'module-doSth', type: 'doSth', hub: 'main'}
]);