Angularjs How to generate HTML code Documentation

14,354

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:

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
Share:
14,354
alchemication
Author by

alchemication

Updated on June 08, 2022

Comments

  • alchemication
    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
    alchemication over 11 years
    Thanks, what I was looking for is a properly documented Angular app, not Angular source code, but still learned some tricks from there...
  • Ben Lesh
    Ben Lesh over 11 years
    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.
  • Florian F
    Florian F over 11 years
    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...
  • Ben Lesh
    Ben Lesh over 10 years
    This is a better answer now. I'd delete mine if I could, but I can't because it's accepted.
  • Aaron Butacov
    Aaron Butacov about 10 years
    The main website for the project is gone.
  • Stephen
    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
    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
    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
    pearpages almost 9 years