Re: [Jsdoc-user] JSDoc generating thinks one of my methods is a subclass.
Status: Inactive
Brought to you by:
mmathews
From: Gabriel R. <gab...@gm...> - 2007-03-25 16:10:37
|
On Thu, Mar 08, 2007 at 10:35:31AM -0800, Leslie Freeman wrote: > Hello, > I've recently started using JSDoc and been very pleased. I have run > into one slight problem though. When I run JSDoc on the following > code, it generates class documentation for ImageLoader and > ImageLoader.ininitlize. initilize is a method and not a class. What > do I need to do do my code to stop JSDoc from being confused? > Note: it is not generating a class doc for ImageLoader.onImageLoad, > only for .initilize ... > /** > * Construct a new ImageLoader object. Begins image loading. > *<p> > * Options:<br> > * <li>container - an element, such as a div, to display the image > in. If a container is specified ImageLoader will also display a > loading image. > * <li>beforeLoad - a command to be excecuted before loading starts > * <li>afterLoad - a command to be excecuted when the image is loaded > * > * @class This is the ImageLoader class. > * @param {String} image_url The URL of the image to load. > * @param {Array} options An array of 'key':'value' option pairs -- > see description. > * @constructor > */ > initialize: function(image_url, options) { > //function code > }, Hi, Sorry for only replying to this now; I've been very out of touch with this project as of late and I'm just now going through these mails to try to clear out some of these issues. The solution here is that you just have to remove the @class and @constructor tags from the documentation for the "initialize" function. These tags are normally used to give JSDoc a hint that a function is actually the constructor function for a class (and to therefore ensure that the class is recognized as such), but here they're making JSDoc think that initialize is itself a function. In any case, by removing these two tags it should be cleared up. Gabriel |