docs should print usage for services that are functions

This commit is contained in:
Igor Minar 2011-02-06 21:17:58 -08:00
parent f00b157841
commit f3a39a6418

View file

@ -432,9 +432,25 @@ Doc.prototype = {
},
html_usage_service: function(dom){
var self = this;
dom.h('Description', this.description, dom.html);
dom.h('Dependencies', this.requires);
if (this.param.length) {
dom.h('Usage', function(){
dom.code(function(){
dom.text(self.name.split('.').pop());
dom.text('(');
self.parameters(dom, ', ');
dom.text(');');
});
self.html_usage_parameters(dom);
self.html_usage_this(dom);
self.html_usage_returns(dom);
});
}
dom.h('Methods', this.methods, function(method){
var signature = (method.param || []).map(property('name'));
dom.h(method.shortName + '(' + signature.join(', ') + ')', method, function(){