如何使用JSDoc记录函数

时间:2013-06-03 18:54:11

标签: javascript documentation standards documentation-generation jsdoc

JSDoc似乎没有接受我的大部分功能。这是一个例子:

/**
 * Function one.
 */
(function one() {
    /**
     * Function two.
     */
    function two() {
        /**
         * Function three.
         */
        function three() {
        }
    }
})();

var four = {
    /**
     * Function five/six.
     */
    five: function six() {
    },
    /**
     * Function seven/eight.
     */
    seven: function eight() {
    },
};

nine.ten = {
    /**
     * Function eleven/twelve.
     */
    eleven: function twelve() {
        /**
         * Function thirteen/fourteen.
         */
        var thirteen = function fourteen() {
        };
    },
    /**
     * Function fifteen/sixteen.
     */
    fifteen: function sixteen() {
    },
};

/**
 * Function eighteen
 */
seventeen(function eighteen() {
});

/**
 * Function twenty.
 */
nineteen(function twenty() {
    /**
     * Function twentyTwo.
     */
    twentyOne(function twentyTwo() {
    });
});

/**
 * Function twentyThree.
 */
function twentyThree() {
}

JSDoc只接受功能二十三。其余的都完全错过了。

我做错了什么?

1 个答案:

答案 0 :(得分:5)

这是一个可以从JSDoc(3)获得更多输出的示例:

/**
 * Function one.
 * @namespace one
 */
(function one() {
    /**
     * Function two.
     * @namespace two
     * @memberof one
     */
    function two() {
        /**
         * Function three.
         * @memberof one.two
         */
        function three() {
        }
    }
})();
相关问题