Open bptremblay opened 8 years ago
So currently, short-jsdoc is not binding the javascript ast with the jsdoc ast at all. As you said there are at least two approaches to solve this. Currently the easy one for jsdoc would be the yuidoc approach. I will mark this as an enhancement. Thanks.
This is like the behavior of YUIDoc, but not like the behavior of jsDoc. This places a burden on the developer to annotate every public method.
For an algorithm point of view, YUIDoc is sort of like this: 1) Parse source for /\ comments. 2) Read known tokens for annotations & parse optional parameters. 3) Whatever non-commented code that comes after this comment, link to the comment! 4) Apply model to a template.
Whereas jsDoc is more like this: 1) Use AST to identify modules, classes, globals, and methods. 2) Walk through all of these, and look for comments. 3) If comments are found, merge them, if not generate inferred documentation. 4) Apply model to a template.