@fileoverview Uses Gulpjs and Browser-Sync to create a server
@author Scott Nath
@requires NPM:gulp-doxx
@requires ./lib/get-options
var gulpDoxx = require('gulp-doxx');
var path = require('path');
var mergeOptions = require('../get-options').mergeOptions;
Function to get default options for an implementation of gulp-doxx
var getDefaultOptions = function () {
'use strict';
// default options for doxx gulp task
var options = {
config: {
title: 'Project Title',
urlPrefix: null,
template: path.join(__dirname, '../templates/doxx.template.jade')
},
src: [
'!./node_modules
/',
'./
.js'
],
dest: './docs',
dependencies: [] // gulp tasks which should be run before this task
};
return options;
};
@param | Type | Description |
---|---|---|
gulp | Object | including file should inject the gulp module |
projectOptions | Object | object of options |
Gulp task to create javascript documentation using doxx
exports.gulpDoxx = function (gulp, projectOptions) {
'use strict';
var options = mergeOptions(getDefaultOptions(), projectOptions);
gulp.task('doxx', options.dependencies, function () {
return gulp.src(options.src)
.pipe(gulpDoxx(options.config))
.pipe(gulp.dest(options.dest));
});
};