16

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!

2
  • Is there a specific question? Commented Oct 11, 2012 at 15:15
  • Would that be ok as a question (pelase see updated content and subject)? I spent a lot of time documenting my program and the html output from JSDoc command line utility is just horrible and does not cover even 5% of my app... Commented Oct 11, 2012 at 15:33

3 Answers 3

33

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

Sign up to request clarification or add additional context in comments.

6 Comments

This is a better answer now. I'd delete mine if I could, but I can't because it's accepted.
The main website for the project is gone.
@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.
@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?
@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.
|
4

EDIT: See John David Five's answer below

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

3 Comments

Thanks, what I was looking for is a properly documented Angular app, not Angular source code, but still learned some tricks from there...
That'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.
Did 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...
1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.