Angularjs How to generate HTML code Documentation
Solution 1
EDIT: See John David Five's answer below
My answer was much, much older and should no longer be accepted.
Solution 2
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
Solution 3
Build steps:
- npm install -g grunt-cli
- git clone https://github.com/angular/angular.js
- cd angular.js
- npm install
- grunt package
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
alchemication
Updated on June 08, 2022Comments
-
alchemication about 2 years
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!
-
alchemication over 11 yearsThanks, what I was looking for is a properly documented Angular app, not Angular source code, but still learned some tricks from there...
-
Ben Lesh over 11 yearsThat's a confusing distinction. At lot of their source is in angular modules, which is an angular app. There are examples in there for how to document a directive, a filter, a service, etc.
-
Florian F over 11 yearsDid you manage to get a correct output? Because directives and filters are function calls and not function definitions, I'm wondering if it's even possible to document them...
-
Ben Lesh over 10 yearsThis is a better answer now. I'd delete mine if I could, but I can't because it's accepted.
-
Aaron Butacov about 10 yearsThe main website for the project is gone.
-
Stephen almost 10 years@AaronHarun For what it's worth, my company has stepped in and we're now sponsoring the docular project. The site should be back up within the next few days and there will be a corporate maintainer with a bunch of people eager to contribute.
-
zpydee almost 10 years@Stephen i've been trying to get docular up and running as an alternative to ngdocs but i'm battling to get it working. we're using yaml to configure grunt. could this be cauding the issue?
-
Stephen almost 10 years@zpydee Unsure. Please leave a message with some of the configuration details on the issue list (github.com/Vertafore/docular/issues) and I'll take a look today.
-
pearpages almost 9 yearsWhat about "dgeni"? github.com/angular/angular.js/wiki/… github.com/angular/dgeni