how to document such things

5 views
Skip to first unread message

XianA...@gmail.com

unread,
Aug 27, 2007, 11:48:49 PM8/27/07
to JsDoc Toolkit Users
hi there, everyone.

I am a newbie to JsDoc Toolkit, and occur something I can't solve,
hope you give me a hand, thanks advance.

The problem is, when I use the "module pattern", documentation in the
return exprssion would missssss...for example:

var Foo = function(){

var private = here;

return {

@static
@desc descriptions here.

method1: function(){
//blah blah codes here
}

}

}();

JsDoc Toolkit will igore everything in the return block, so how can I
get it worked?


realazy

Michael Mathews

unread,
Aug 28, 2007, 5:19:27 AM8/28/07
to jsd...@googlegroups.com
Hello,

I believe you just need the @scope tag, like so:


var Foo = function(){
    var private = here;

    /** @scope Foo */
    return {

        /**
         * @static
         * @desc descriptions here.
         */

        method1: function(){
            //blah blah codes here
        }
    }
}();

That tag is mentioned on the wiki under the heading "Changing Scope" here:
    http://code.google.com/p/jsdoc-toolkit/wiki/DocExamples

Note: As I look at it I realize that page needs updating, so don't consider it complete. Feel free to ask if you have any further questions.

Regards,
Michael

XianA...@gmail.com

unread,
Aug 29, 2007, 12:08:20 PM8/29/07
to JsDoc Toolkit Users
Hi, Michael.

Thanks for your reply.

I have used JsDoc Toolkit in my project, it's so fantastic! thank u,
Michael.

regards,
realazy from Beijing, China :)


On Aug 28, 5:19 pm, "Michael Mathews" <micm...@gmail.com> wrote:
> Hello,
>
> I believe you just need the @scope tag, like so:
>
> var Foo = function(){
> var private = here;
>
> /** @scope Foo */
> return {
>
> /**
> * @static
> * @desc descriptions here.
> */
> method1: function(){
> //blah blah codes here
> }
> }
>
> }();
>
> That tag is mentioned on the wiki under the heading "Changing Scope" here:
> http://code.google.com/p/jsdoc-toolkit/wiki/DocExamples
>
> Note: As I look at it I realize that page needs updating, so don't consider
> it complete. Feel free to ask if you have any further questions.
>
> Regards,
> Michael
>

Michael Mathews

unread,
Aug 29, 2007, 12:16:11 PM8/29/07
to jsd...@googlegroups.com
You're welcome, realazy. If you'd like to post a link to your project, I would be interested in seeing it.

Regards,
Michael
Reply all
Reply to author
Forward
0 new messages