csnover / js-doc-parse

An experimental library for parsing JavaScript files and extracting inline documentation.
31 stars 7 forks source link

can't set summary/description for a module using exports #42

Open wkeese opened 12 years ago

wkeese commented 12 years ago

It's near-impossible to setup a summary/description for modules using "exports". For example see dojo/dom-attr.js.

I tried to hack it with by adding this to the end of the file, but it didn't work:

/*=====
var ret = {
    // summary:
    //      This module defines the core dojo DOM attributes API.
};
lang.mixin(ret, exports);
return ret;
=====*/

See also http://bugs.dojotoolkit.org/ticket/13769#comment:40, it's not trivial to remove the use of exports.

csnover commented 12 years ago

Do you have any thoughts on the way this should be handled? It seems impossible with dojodoc. jsdoc could handle it just fine but we have no processor for that yet.

wkeese commented 12 years ago

I had one suggestion above but it's kind of yucky because the module is both using exports and returning a value.

This seems like a similar problem to NodeList-fx.js etc., where we need a summary/description on the module itself, which overrides whatever summary/description is attached to the return value.