如何记录与JSDoc3 AMD +骨干工程(How do I document AMD + Back

2019-07-20 19:43发布

我有一个骨干样板基础的项目,我想最近记录jdoc的工具包

虽然我不能让它产生任何东西,但空_global类

代码示例:

/**
 * This is a root model for DLClass
 * @module models/DLClass
 */
define([
    'underscore',
    'backbone'
], /** @lends DLClass */ function (_, Backbone) {        
    /**
     * This is a root model for DLClass
     * @class DLClass
     * @constructor
     * @return Session Object
     */
    var DLModel = Backbone.Model.extend({
        /** @lends DLClass.prototype */

    /**
     * Generic tap event
     * @param touchEvent
     */
    onTap: function (touchEvent) {

    },

Answer 1:

尝试添加@namespace让JSDoc知道通过模块的内容看。 并定义模块,将其使用的功能@name

/** 
 * This is a root model for DLClass
 * @module models/DLClass
 * @namespace
 */
define([
    'underscore',
    'backbone'
], /** @lends DLClass */ function (_, Backbone) {        
    /**
     * This is a root model for DLClass
     * @class DLClass
     * @module models/DLClass
     * @name DLClass
     * @constructor
     * @return Session Object
     */
    var DLModel = Backbone.Model.extend({
        /** @lends DLClass.prototype */

        /**
         * Generic tap event
         * @name DLClass.onTap
         * @function
         * @param touchEvent
         */
        onTap: function (touchEvent) {

        },


文章来源: How do I document AMD + Backbone project with JSDoc3