-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation generator for JS client? #2079
Comments
I don't have a direct answer to your question but the style guide we used for JS can be found here: https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md#style-guide Are you using any IDE with the JS API client generated by swagger codegen? If yes, does the IDE properly show the method/class documentation? For the tools you mentioned (ESDoc, JSDoc, etc), I've not tried any of those myself so I can't comment but feel free to suggest any other style in documenting the JS code. |
@delenius Are you looking for developer documentation? There's a great package called dox from TJ, the original author of express.js (and lots of other popular node.js frameworks). If you search github for just 'dox' then filter by JavaScript repositories, you'll find quite a few generators based off of dox. It's also fairly simple to use dox to manually pull all comments and output those comments to some other format. Before the express.js swagger plugin existed, I used to use dox to pull custom comments and generate my swagger spec. Here's an example of the output from https://github.com/punkave/dox-foundation: You can install dox-foundation, then run:
|
@jimschubert @delenius I've submitted #2320 to add auto-generated documentation (markdown) for Perl. We can do the same for Javascript. Would that meet your requirement? |
@wing328 I think users generating JavaScript would probably prefer the use of modules so they can customize the documentation. For instance, one could add
Then, Is there a benefit to adding auto-generated documentation over using a module? |
@jimschubert thanks for the feedback. Before I decide to use a library/module/SDK, I usually take a look at the documentation first. If a library/module/SDK is poorly documented, it's unlikely I would give it a try if there are alternatives available. In other words, the documentation is the first impression to some (if not all) developers before consuming the library/module/SDK so the auto-generated documentation (markdown) may help in that regard. As you've pointed out, JS developers may prefer To me, I think we should offer both and let the JS developers decide which one they want to use during development. (of course resource may be a constraint here and hopefully our vibrant community can fill the gap on that) |
Regarding doc comment style in JavaScript, it seems JSDoc is the most popular one, which is also supported by dox. So I guess we should use JSDoc in JavaScript client codegen. Regarding generating the actual doc files (e.g. in Markdown or HTML), I think providing a default template would be helpful, while other templates can be added freely as long as they recognise JSDoc tags. For example, there are several templates listed on JSDoc's github repo. |
Auto-generated markdown documentation added to JS code generator. We'll keep this task open for the time being while support for other JS documentation style is being worked on by the community. |
The generated client code has nice documentation comments, but I haven't been able to produce any good output from it. Is there actually a JS api doc generator that produces any good output from these sources? I've tried ESDoc, JSDoc, and YUIDoc, and all came out with essentially empty output. Is there a magic tool/configuration combo that works?
The text was updated successfully, but these errors were encountered: