micmath/jsdoc — Issue #50: Namespaces are broken
Author: ProLoser
Created: 2011-10-18 22:57:46+00:00
State: open

Namespace descriptions are used as the name.

If the namespace doesn't have a description, but uses dot notation (jv.Apply) only the last item is used. This is fine, except it makes it difficult to track it's parent in the generated docs.

Functions inside the namespace are being thrown under global instead of the namsepace.

I switched from 2 to 3 and regenerated my docs and have had a few steps backwards as far as results go.

Here is some example code:

```
jv.Util = (function(){
// PRIVATE
var _ajaxCache = {};

return {
months: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
/**
* Utility wrapper for $.ajax();
*
* args.ajaxType is required, must be unique
* @example jv.UTIL.ajax({ ajaxType: 'test', url: 'profile/mine' });
* @param {Object} args (required)
* @type $.Deferred()
*/
ajax: function(args) {
}
};
})();
jv.Factory = (function() {
// PRIVATE
/**
* Cached flags of which assets & resources have already been loaded
*/
var assets = {};

// PUBLICLY VISIBLE
return {
/**
* Loads all resources specified and issues callback upon completion
*
*/
resource: function(resourceNames, callback) {
callback = callback || $.noop;
if (!$.isArray(resourceNames)) {
resourceNames = resourceNames.split(' ');
}
var dfds = $.map( resourceNames, function(r, i) {
return jv.Resources[r]();
});
$.when.apply(null, dfds).done(callback);
},
/**
* Loads the asset from jv.Assets if it hasn't been loaded already
* Assets SHOULD load instantly and not require callbacks
*
* @param assetName string The name of the plugin to load
* @param force boolean [false]: Set to true to ignore previous loads
*/
asset: function(assetNames, force) {
if (!$.isArray(assetNames)) {
assetNames = assetNames.split(' ');
}
$.each(assetNames, function(index, assetName) {
if (force || assets[assetName] === undefined) {
jv.Assets[assetName]();
assets[assetName] = true;
}
});
}
};
})();
/**
* @namespace Asset functions intended to only be used internally by the factory
*/
jv.Assets = {
/**
* Run to initialize batch features on tables
*
* Give a form class `batch` and place a checkbox into a <th> for all or use classes `a.checkAll` and `a.uncheckAll` links
* Compatible with dynamically generated rows
* Adds class `checked` to <th>
*/
tableCheckboxes: function() {
},
/**
* Enables HTML5 Placeholders and validation
*/
forms: function() {
}
};
```