我的所有js文件都有文档,我的文档存在于以下文件夹结构中:
myapplication/js/controllers/samplecontroller.js
myapplication/js/directives/sampledirective.js
myapplication/js/main.js
myapplication/js/app.js
我的gulp任务是:
gulp.task('ngdocs', [], function () {
var gulpDocs = require('gulp-ngdocs');
var options = {
scripts: ['./controllers/*.js','./directives/*.js'],
startPage: '/api',
title: "Awesome Docs",
titleLink: "/api"
}
return gulp.src('myapplication/js/*.js')
.pipe(gulpDocs.process(options))
.pipe(gulp.dest('./docs'));
});
我注意到生成的文档只是拾取“main.js”和“app.js”中的文档。有没有办法让我在“/ controllers”和“/ directives”下的所有文件都被拾取?或者这不是常见做法吗?
答案 0 :(得分:3)
您应该在文件夹结构中指定递归运算符**
,如下所示:
return gulp.src('myapplication/js/**/*.js')