Reputation: 81
There are 2 grunt plugins for generating docs for Angularjs applications.
https://www.npmjs.org/package/grunt-ngdoc
https://www.npmjs.org/package/grunt-ngdocs
What's the difference and which one should I use?
grunt-ngdoc
ngdoc: { options: { dest: 'docs' scripts: ['../app.min.js'], html5Mode: true, startPage: '/api', title: 'My Documentation', analytics: { account: 'UA-08150815-0', domainName: 'my-domain.com' }, discussions: { shortName: 'my', url: 'http://my-domain.com', dev: false } }, tutorial: { src: ['content/tutorial/*.ngdoc'], title: 'Tutorial' }, api: { src: ['src/**/*.js', '!src/**/*.spec.js'], title: 'API Documentation' } }
ngdocs
ngdocs: { options: { dest: 'docs' scripts: ['../app.min.js'], html5Mode: true, startPage: '/api', title: "My Awesome Docs", image: "path/to/my/image.png", imageLink: "http://my-domain.com", titleLink: "/api", bestMatch: true, analytics: { account: 'UA-08150815-0', domainName: 'my-domain.com' }, discussions: { shortName: 'my', url: 'http://my-domain.com', dev: false } }, tutorial: { src: ['content/tutorial/*.ngdoc'], title: 'Tutorial' }, api: { src: ['src/**/*.js', '!src/**/*.spec.js'], title: 'API Documentation' } }
Upvotes: 3
Views: 5365
Reputation: 1564
package grunt-ngdocs https://github.com/m7r/grunt-ngdocs works fine (but long time haven't updated)
for ng1.6 works for me:
ngdocs: {
all: ['app/**/*.js']
}
you will see the old version of angular 1.2.* in
cat docs/js/angular.min.js | grep v1
AngularJS v1.2.16
but it does not affect your source files.
dont forget run server
e.g using python
pushd ./dist; python -m SimpleHTTPServer 9000; popd #v 2.*
pushd ./dist; python -m http.server 9000; popd #v 3.*
Upvotes: 0
Reputation: 24324
Well, the AngularJS wiki does have some information about how to write documentation: https://github.com/angular/angular.js/wiki/Writing-AngularJS-Documentation
The flavour of
jsdoc
used by AngularJS is calledngdo
c and is parsed by a Node.js utility calledDgeni
.
More info about Dgeni
here: https://github.com/angular/dgeni
Upvotes: 1
Reputation: 8064
I wondered the same thing today. I noticed ngdocs https://github.com/m7r/grunt-ngdocs was undergoing more active development than ngdoc https://github.com/bevacqua/grunt-ngdoc. As a result I decided to go with ngdocs.
UPDATE: I tried both and was able to get ngdocs working for my project, but was not able to get ngdoc working.
Upvotes: 14
Reputation: 3504
There is also grunt-docular to generate documentation in AngularJS' style. But with no activity for months :( To me it looks angular team did some improvements since then, but only for their internal use
Upvotes: 1