forked from codeceptjs/CodeceptJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
29 lines (23 loc) · 998 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const path = require('path');
const gulp = require('gulp');
const documentation = require('gulp-documentation');
const glob = require('glob');
const mustache = require('gulp-mustache');
const cpath = '.';
gulp.task('docs', () => {
glob.sync(path.join(cpath, 'lib/helper/*.js')).forEach((file) => {
gulp.src(file)
.pipe(gulp.dest(path.join(cpath, 'docs/build')))
.pipe(mustache({}, {extension: '.js'}))
.pipe(gulp.dest(path.join(cpath, 'docs/build')))
.pipe(documentation({ filename: path.basename(file, '.js') + '.md', shallow: true, format: 'md'}))
.pipe(gulp.dest(path.join(cpath, 'docs/helpers')));
});
const api = ['container', 'config', 'recorder', 'output', 'helper', 'codecept'];
api.forEach((baseName) => {
gulp.src(path.join(cpath, `lib/${baseName}.js`))
.pipe(documentation({ filename: baseName + '.md', shallow: true, format: 'md'}))
.pipe(gulp.dest(path.join(cpath, 'docs/api')));
});
});
gulp.task('default', ['docs']);