Can one @namespace span across several files?

439 views
Skip to first unread message

Mikko Ohtamaa

unread,
Feb 27, 2011, 4:24:14 PM2/27/11
to JsDoc Toolkit Users
Hi,

I am trying to split my namespace to several JS files.

First file:


/**
* @namespace mobilize
*/
mobilize = {
a : function() {}
};

Second file:

mobilize.extend(mobilize, {
b : function() {}
})

Can I make jsdoc-toolkit somehow to understand that code in the second
files belongs to mobilize namespace?

Michael Mathews

unread,
Feb 27, 2011, 5:34:02 PM2/27/11
to jsd...@googlegroups.com
The fact that your doc comments are in different files should make no difference to JSDoc. So the question is simply how to document that the method "b" is a member of "mobilize". You can either use a @memberOf mobilize tag, or if you want to quickly document that all members of an object literal are being attached to "mobilize", you can use a @lends mobilize tag. Like so:

// First file:

/**
* @namespace mobilize
*/
mobilize = {
    /** document me */
    a : function() {}
};

// Second file:

mobilize.extend(mobilize, /** @lends mobilize */ {
    /** document me */
    b: function() {}
});

-- 
Michael Mathews
--
You received this message because you are subscribed to the Google Groups "JsDoc Toolkit Users" group.
To post to this group, send email to jsd...@googlegroups.com.
To unsubscribe from this group, send email to jsdoc-2+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jsdoc-2?hl=en.

Mikko Ohtamaa

unread,
Feb 27, 2011, 6:29:51 PM2/27/11
to JsDoc Toolkit Users


On Feb 28, 12:34 am, Michael Mathews <micm...@gmail.com> wrote:
>  The fact that your doc comments are in different files should make no
> difference to JSDoc. So the question is simply how to document that the
> method "b" is a member of "mobilize". You can either use a @memberOf
> mobilize tag, or if you want to quickly document that *all* members of an
> object literal are being attached to "mobilize", you can use a @lends
> mobilize tag. Like so:

@lends did the trick. Thanks!
Reply all
Reply to author
Forward
0 new messages