简体   繁体   English

如何使用JSDoc记录功能

[英]How to document functions with JSDoc

JSDoc doesn't seem to pick up on most of my functions. JSDoc似乎不支持我的大多数功能。 Here's an example: 这是一个例子:

/**
 * 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 only picks up on function twentyThree. JSDoc只选择功能二十三。 The rest are completely missed. 其余的都完全错过了。

What am I doing wrong? 我究竟做错了什么?

This is one example that will give you more output from JSDoc(3): 这是一个示例,它将为您提供JSDoc(3)的更多输出:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM