dtao / autodoc

Doc generation on steroids
https://npmjs.org/package/autodoc
MIT License
232 stars 15 forks source link

Regular block comments (instead of javadoc-style /**) work, but /* shows up in the documentation #32

Closed hazeledmands closed 10 years ago

hazeledmands commented 10 years ago

If your javascript looks like this:

/*
Does a thing
*/
MyLibrary.prototype.thing = function() {
  return console.log("Thing done!");
};

(Note the single asterisk after the slash, instead of two.) Then you end up with documentation that looks like this:

With the uncomfortable /* in there.

This is perhaps only an issue because ### block comments in CoffeeScript become /*-style JavaScript block comments.

hazeledmands commented 10 years ago

This could be fixed by modifying doctrine. I've submitted a pull request to that project: Constellation/doctrine#14.

But maybe we would rather ignore regular block comments and only parse the jsdoc ones?

dtao commented 10 years ago

So, looks like your change got merged into doctrine—nice! I took another look and, strangely, couldn't figure out why I had ever wrapped comments in /* and */ in the first place. Doctrine seems to parse without them just fine (and looking at your PR, it's easy to see why: it was just stripping them out anyway). So I took out that logic and the problem seems to have gone away.

hazeledmands commented 10 years ago

Yay, right on! :D