diff --git a/.gitignore b/.gitignore index 709b6ca..66c7758 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ node_modules/ bower_components/ coverage/ +docs/ .sass-cache/ .idea/ .tmp/ diff --git a/gulp/build.js b/gulp/build.js index 2c726b4..03fc389 100644 --- a/gulp/build.js +++ b/gulp/build.js @@ -98,4 +98,8 @@ gulp.task('clean', function () { return $.del([path.join(conf.paths.dist, '/'), path.join(conf.paths.tmp, '/')]); }); +gulp.task('clean-docs', [], function() { + return $.del([path.join(conf.paths.docs, '/')]); +}); + gulp.task('build', ['html', 'fonts', 'other']); diff --git a/gulp/conf.js b/gulp/conf.js index fcec9c2..30996d4 100644 --- a/gulp/conf.js +++ b/gulp/conf.js @@ -15,7 +15,8 @@ exports.paths = { src: 'src', dist: 'dist', tmp: '.tmp', - e2e: 'e2e' + e2e: 'e2e', + docs: 'docs' }; /** diff --git a/gulpfile.js b/gulpfile.js index 5669b5d..136629b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -27,3 +27,42 @@ wrench.readdirSyncRecursive('./gulp').filter(function(file) { gulp.task('default', ['clean'], function () { gulp.start('build'); }); + +gulp.task('ngdocs', ['clean-docs'], function () { + var gulpDocs = require('gulp-ngdocs'); + var options = { + scripts: [ + 'bower_components/angular/angular.min.js', + 'bower_components/angular/angular.min.js.map', + 'bower_components/angular-animate/angular-animate.min.js', + 'bower_components/angular-animate/angular-animate.min.js.map' + //'bower_components/angular/angular.js' + ], + html5Mode: true, + startPage: '/', + title: "Noosfero Angular Theme Documentation", + //image: "path/to/my/image.png", + //imageLink: "http://my-domain.com", + titleLink: "/", + loadDefaults: { + angular: false, + angularAnimate: false + } + } + return gulpDocs.sections({ + api: { + glob:[ + //'src/**/*.js', '!src/noosfero.js', '!src/noosfero-specs.js' + //'src/noosfero.js' + 'src/**/*.ts' + ],//, '!src/**/*.spec.js'], + api: true, + title: 'API Documentation' + }, + tutorial: { + glob: ['content/tutorial/*.ngdoc'], + title: 'Tutorial' + } + }).pipe(gulpDocs.process(options)).pipe(gulp.dest('./docs')); +}); + diff --git a/package.json b/package.json index b13bb2b..ee69ded 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "dependencies": { "angular": "^1.5.0", "angular-mock": "^1.0.0", - "moment": "^2.11.2" + "moment": "^2.11.2" }, "scripts": { "webpack": "webpack", @@ -41,6 +41,7 @@ "gulp-minify-css": "~1.2.1", "gulp-minify-html": "~1.0.4", "gulp-ng-annotate": "~1.1.0", + "gulp-ngdocs": "0.2.13", "gulp-protractor": "~1.0.0", "gulp-rename": "~1.2.2", "gulp-replace": "~0.5.4", -- libgit2 0.21.2