如何使用 yuidoc 记录命名空间?
How to document a namespace using yuidoc?
YUIDoc doesn't seem to be generating any documentation for my namespace. This project uses the Revealing Module 设计模式
/*
* Example namespace.
*
* @namespace MY_NAMESPACE
*/
var MY_NAMESPACE = (function() {
/**
* @property privateProperty1
* @type {Number}
* @private
*/
var privateProperty1 = 1;
/**
* Logs the method name to the console.
* @method privateMethod1
* @private
*/
var privateMethod1 = function() {
console.log('In privateMethod1');
};
return {
/**
* @property publicProperty1
* @type {Number}
*/
publicProperty1: 2,
/**
* Logs a simple message to the console.
*
* @method publicMethod1
* @param {String} aString A string to log.
*/
publicMethod1: function(aString) {
console.log('In publicMethod1 and was passed: ' + aString);
}
}
})();
@namespace
需要包含一个 @class
如果你想使用 @namespace
如下,但你可能想使用 @class
而不是 @namespace
.
/**
* Example namespace.
* @namespace MY_NAMESPACE
*/
/**
* Example class.
* @class MyClass
*/
YUIDoc doesn't seem to be generating any documentation for my namespace. This project uses the Revealing Module 设计模式
/*
* Example namespace.
*
* @namespace MY_NAMESPACE
*/
var MY_NAMESPACE = (function() {
/**
* @property privateProperty1
* @type {Number}
* @private
*/
var privateProperty1 = 1;
/**
* Logs the method name to the console.
* @method privateMethod1
* @private
*/
var privateMethod1 = function() {
console.log('In privateMethod1');
};
return {
/**
* @property publicProperty1
* @type {Number}
*/
publicProperty1: 2,
/**
* Logs a simple message to the console.
*
* @method publicMethod1
* @param {String} aString A string to log.
*/
publicMethod1: function(aString) {
console.log('In publicMethod1 and was passed: ' + aString);
}
}
})();
@namespace
需要包含一个 @class
如果你想使用 @namespace
如下,但你可能想使用 @class
而不是 @namespace
.
/**
* Example namespace.
* @namespace MY_NAMESPACE
*/
/**
* Example class.
* @class MyClass
*/