While looking for a good way to document our AngularJS codebase I stumbled upon the “Sigh, AngularJS Documentation” by Allan Kim. His quest for simple Angular documentation ended in the creation of angular-jsdoc, his own Angular Template for JSDoc. I completely agree with his decision and found his template to be perfectly suited for our goals (using common js doc blocks, no server for browsing documentation).
Using the template is incredibly easy and only requires you to add a single
@ngdoc attribute in your JSDoc to group the angular files together:
We document every exposed function in a module with regular JSDoc blocks. In this example we specify that the function belongs to the
Auth module using the
To generate the docs automatically with each build I used grunt-jsdoc with the following configuration:
Running the grunt jsdoc task generates the simple, basic and clear html documentation: