问题
I am looking for a JSDoc parser that I can use in my project. I am looking for something where I can pass in a JSDoc comment and receive a structured description of what that comment means. Most of the tools I have seen seem to be able to transform JSDoc comments into HTML or some other format. I am looking for something that will provide the intermediate representation of a comment that can be used to feed into other tools.
Are there any tools or libraries out there that I can use?
回答1:
The Doctrine project does exactly what I am looking for:
http://eslint.org/doctrine/demo/
回答2:
If you need only parsing functionality and don't care about tags meaning then comment-parser may help
回答3:
There is also a dojo project: https://github.com/wkeese/js-doc-parse
see http://www.sitepen.com/blog/2013/01/18/generating-and-viewing-custom-api-docs/
it will look like the dojo documentation ( http://dojotoolkit.org/api/ )
回答4:
what about jsdoc itself ? - with the command line jsdoc yourfile.js -X > parsed.json . With that you have the official thing.
来源:https://stackoverflow.com/questions/11851556/are-there-any-open-source-jsdoc-parser-written-in-javascript