简体   繁体   中英

Angularjs How to generate HTML code Documentation

Does anyone have any experience in documenting/structuring angularjs projects so the JSDoc can generate nice comments (for your directives, controllers, filters etc.) in an HTML format? At the moment it generates one file with the _global class that points to the namespace of my app with couple functions and that's it...

Or maybe there is a better way to generate html version of doc blocks in angularjs?

PS: I am using standard jsdoc syntax to document my code (@param, @return etc.)

Update: My specific question is: Is there any way to generate html documentation for angularjs doc blocks to cover all controllers/directives/filters etc.? When ran JSDoc command line utility it covered only about 5% of my code in the HTML report...

Thanks!

I have been working on a grunt plugin that utilizes AngularJS's documentation generation code. It follows their syntax and output. grunt-docular . The link shows documentation generation for the docular source as well as the original AngularJS source. It's configurable and extendible.

Go to grunt-docular and find the install link for an example of creating your own documentation

EDIT: See John David Five's answer below

My answer was much, much older and should no longer be accepted.

Build steps:

Docs will be availiable at build/docs folder. If you have PHP 5.5 you can view it with:

  • cd build
  • php -S localhost:8000
  • view in browser: http://localhost:8000/docs/index.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM