chore(docs): initial dgeni docs generation

Closes #261
This commit is contained in:
Peter Bacon Darwin
2014-12-04 14:02:03 +00:00
parent 983c00c495
commit 27e03591dd
28 changed files with 1515 additions and 1 deletions

View File

@ -399,3 +399,58 @@ gulp.task('build', function(done) {
gulp.task('analyze', function(done) {
runSequence('analyze/analyzer.dart');
});
// --------------
// doc generation
var Dgeni = require('dgeni');
gulp.task('docs/dgeni', function() {
try {
var dgeni = new Dgeni([require('./docs/dgeni-package')]);
return dgeni.generate();
} catch(x) {
console.log(x.stack);
throw x;
}
});
var bower = require('bower');
gulp.task('docs/bower', function() {
var bowerTask = bower.commands.install(undefined, undefined, { cwd: 'docs' });
bowerTask.on('log', function (result) {
console.log('bower:', result.id, result.data.endpoint.name);
});
bowerTask.on('error', function(error) {
console.log(error);
});
return bowerTask;
});
gulp.task('docs/assets', ['docs/bower'], function() {
return gulp.src('docs/bower_components/**/*')
.pipe(gulp.dest('build/docs/lib'));
});
gulp.task('docs/app', function() {
return gulp.src('docs/app/**/*')
.pipe(gulp.dest('build/docs'));
});
gulp.task('docs', ['docs/assets', 'docs/app', 'docs/dgeni']);
gulp.task('docs-watch', function() {
return gulp.watch('docs/app/**/*', ['docs-app']);
});
var jasmine = require('gulp-jasmine');
gulp.task('docs/test', function () {
return gulp.src('docs/**/*.spec.js')
.pipe(jasmine());
});
var webserver = require('gulp-webserver');
gulp.task('docs/serve', function() {
gulp.src('build/docs/')
.pipe(webserver({
fallback: 'index.html'
}));
});