JsDoc produces no documentation and no errors #46

Closed
crfroehlich opened this Issue Jul 5, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@crfroehlich

Using grunt-jsdoc v 0.4.0, I cannot get any documentation output from my project. I've attached a complete gist with the debug output here and you can view my project on Github: OJ.

If I run grunt jsdoc with only a single file, in the doc folder specified I get an index.html file with a single link to Main, which points to file:///C:/. If I run it against all of my JS files, I get an index.html file with links to only 2 classes, each with a single method defined. No errors are reported in either case.

I'm a bit perplexed. I have scrupulously documented nearly every public and private method in my codebase with jsdoc3 style comments.

Further, grunt-jsdoc does not seem to be recognizing the additional options I specify, such as for the markdown plugin and the verbose output.

@krampstudio

This comment has been minimized.

Show comment
Hide comment
@krampstudio

krampstudio Jul 5, 2013

Owner

Please try to run the command produced in the debug. If the result is the same, this is an issue from jsdoc3 (it can be really capricious if something isn't well defined).

Owner

krampstudio commented Jul 5, 2013

Please try to run the command produced in the debug. If the result is the same, this is an issue from jsdoc3 (it can be really capricious if something isn't well defined).

@crfroehlich

This comment has been minimized.

Show comment
Hide comment
@crfroehlich

crfroehlich Jul 6, 2013

Running the jsdoc command produces the same output. It sounds like I'll have to keep digging.

[Update]

I did continue on to npm install jsdoc globally, so when I run jsdoc directly (as opposed to running from the grunt-jsdoc location ~node_modules\grunt-jsdoc\node_modules\jsdoc\jsdoc) with the --debug flag, I actually get the rhino debugger and can step through. It looks like the first problem is that jsdoc is looking for the 'plugins' folder at the root of my project (probably a red herring since it would normally look from the grunt-jsdoc relative path). Once removed, I can step through the entire execution without exception.

Further suggesting this is jsdoc's problem; but seems worth pointing out.

Running the jsdoc command produces the same output. It sounds like I'll have to keep digging.

[Update]

I did continue on to npm install jsdoc globally, so when I run jsdoc directly (as opposed to running from the grunt-jsdoc location ~node_modules\grunt-jsdoc\node_modules\jsdoc\jsdoc) with the --debug flag, I actually get the rhino debugger and can step through. It looks like the first problem is that jsdoc is looking for the 'plugins' folder at the root of my project (probably a red herring since it would normally look from the grunt-jsdoc relative path). Once removed, I can step through the entire execution without exception.

Further suggesting this is jsdoc's problem; but seems worth pointing out.

@crfroehlich

This comment has been minimized.

Show comment
Hide comment
@crfroehlich

crfroehlich Jul 6, 2013

Ok. After some deep soul googling, I think I'm finally on the path to yes. After starting from @darlingjs blog post Creation of JavaScript Documentation, which is what launched my journey; I found @jewelsjacobs post Finally got JsDocs working with Node in which she ultimately opted to settle for the older jsdoc-toolkit. Unsatisfied, I finally found post How I introduced JsDoc by Simon Williams.

The key appears to be using

/**
* @memberOf jQuery
*/

After doing so in a single file, a few of my methods began appearing in the output. Then the remaining problems became much more obvious, most critically--when using Object.defineProperty, you have to specify the @name decorator. By whatever means JsDoc is parsing the AST, it is not associating property/method names with their corresponding objects; since this is the only way I add new properties/methods--I didn't get any documentation.

I think this is problem solved for me.

Ok. After some deep soul googling, I think I'm finally on the path to yes. After starting from @darlingjs blog post Creation of JavaScript Documentation, which is what launched my journey; I found @jewelsjacobs post Finally got JsDocs working with Node in which she ultimately opted to settle for the older jsdoc-toolkit. Unsatisfied, I finally found post How I introduced JsDoc by Simon Williams.

The key appears to be using

/**
* @memberOf jQuery
*/

After doing so in a single file, a few of my methods began appearing in the output. Then the remaining problems became much more obvious, most critically--when using Object.defineProperty, you have to specify the @name decorator. By whatever means JsDoc is parsing the AST, it is not associating property/method names with their corresponding objects; since this is the only way I add new properties/methods--I didn't get any documentation.

I think this is problem solved for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment