如何用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