Has anyone ever documented BackboneJS code with JSDoc?
I'm having problems annotating Backbone constructs such as:
User = Backbone.Model.extend({
defaults: { a: 1 },
initialize: function () {
// ...
},
doSomething: function (p) {
// ...
}
});
Any advice appreciated. Thanks.
chris_b's answer helped me a lot, the sample as well as the link. I had to drop the
@class
annotation, though, or it would generate two entries for the class. Furthermore, I'm adding this answer to show how to annotate static class members (class level constants).(We use require.js.)
I think it works somehow like this, if you're talking about the JSDoc Toolkit:
The important bit is the position of the
@lends
tag!It can be a bit tricky, but if this doesn't work try out some of the other examples: http://code.google.com/p/jsdoc-toolkit/wiki/CookBook