views:

386

answers:

1

I've been trying to use JsDoc for documenting my javascript but I keep coming across this hurdle. It keeps saying "nothing to document, exiting"

Here is the peice of code I'm trying to document:

/**
 * Container for all editing methods
 * @namespace
 */
var FREdit = {

    /**
     * Toggle value for editing
     * @type Number
     */
    isToggleOn:0,

    /**
     * Initialize editing 
     */
    init: function(){
     this.initPopups();
    },

    /**
     * Function to enable editing 
     */
    enable: function(){
     this.enableTitles();
            this.isToggleOn = 1;
    }
};

Above I'm using namespace. Even if I use a variant form of function definition in JavaScript, JSDoc doesn't seem to recognise it. Eg:

/**
 * Just any function
 */
var any_function = function(){

};

Any idea how to get around this? Thanks!

+1  A: 

Judging from your question I'm guessing you're using JSDoc. The original JSDoc has been unsupported for a while now.

I suggest you use jsdoc-toolkit as it has much better support. According to their documentation you can document the class pattern. Take a look at their examples and you should be good to go!

Cheers!

coderjoe
Thanks! I found jsdoc-toolkit after posting this and it works perfectly fine!
Ankit