From 72e5647f214a5cc92b700f9a62cf315d0fe37283 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sat, 11 Apr 2015 13:59:23 -0400 Subject: [PATCH] Adding docco support --- .gitignore | 1 + gulpfile.js | 20 ++++++++++++++++++-- package.json | 2 ++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2bac8e9..36c3cf0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules .sass-cache build +docs diff --git a/gulpfile.js b/gulpfile.js index eed7008..baf5b8a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,10 +9,26 @@ function errorHandler() { }); } -gulp.task('default', ['server'], function() { +gulp.task('default', ['server', 'docs'], function() { gulp.watch(config.globs.other, ['static']); gulp.watch([config.globs.html, config.templateFile, config.globs.sass], ['markup']); - gulp.watch(config.globs.js, ['browserify']); + gulp.watch(config.globs.js, ['browserify', 'docs']); +}); + +gulp.task('docs', ['docs:files'], function() { + var folderToc = require('folder-toc'); + + folderToc('./docs', { + filter: '*.html' + }); +}); + +gulp.task('docs:files', function() { + var docco = require('gulp-docco'); + + return gulp.src(config.globs.js) + .pipe(docco()) + .pipe(gulp.dest('./docs')); }); gulp.task('server', ['build'], function() { diff --git a/package.json b/package.json index 4060e87..fb37b58 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,11 @@ "browserify": "^6.3.4", "canopy": "^0.2.0", "es6ify": "^1.5.1", + "folder-toc": "^0.1.0", "gulp": "^3.8.10", "gulp-compass": "^2.0.3", "gulp-connect": "^2.2.0", + "gulp-docco": "0.0.4", "gulp-notify": "^2.0.1", "gulp-plumber": "^0.6.6", "gulp-tap": "^0.1.3",