如何用JSDoc3记录AMD + Backbone项目

我有一个基于Backbone样板的项目,我想用最近的jdoc-toolkit进行文档化

虽然我不能让它产生任何东西,但空的_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) {

    },

尝试添加@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) {

        },
链接地址: http://www.djcxy.com/p/12139.html

上一篇: How do I document AMD + Backbone project with JSDoc3

下一篇: How are strings physically stored in Javascript