From 694761089e1efb6cd7f37dd549adedd5e6b337b9 Mon Sep 17 00:00:00 2001 From: Matt Mazzola Date: Thu, 14 Jul 2016 11:34:11 -0700 Subject: [PATCH] Change documentation generation to include json file within docs directory. Fix documentation deployment by adding .nojekyll before publishing. --- gulpfile.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index e7f5b6c..8667754 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,6 +2,7 @@ var gulp = require('gulp-help')(require('gulp')); var del = require('del'), ghPages = require('gulp-gh-pages'), header = require('gulp-header'), + fs = require('fs'), moment = require('moment'), rename = require('gulp-rename'), replace = require('gulp-replace'), @@ -40,15 +41,17 @@ gulp.task('test', 'Run unit tests', function (done) { ) }); -gulp.task('ghpages', function () { - return gulp.src(['./docs/**/*']) +gulp.task('ghpages', 'Deploy documentation to gh-pages', ['nojekyll'], function () { + return gulp.src(['./docs/**/*'], { + dot: true + }) .pipe(ghPages({ force: true, message: 'Update ' + moment().format('LLL') })); }); -gulp.task("docs", function () { +gulp.task("docs", 'Compile documentation from src code', function () { return gulp .src(["src/**/*.ts"]) .pipe(typedoc({ @@ -57,15 +60,25 @@ gulp.task("docs", function () { // Output options (see typedoc docs) out: "./docs", + json: "./docs/json/" + package.name + ".json", // TypeDoc options (see typedoc docs) ignoreCompilerErrors: true, - version: true, - tsConfig: './tsconfig.json' + version: true })) ; }); +gulp.task('nojekyll', 'Add .nojekyll file to docs directory', function (done) { + fs.writeFile('./docs/.nojekyll', '', function (error) { + if (error) { + throw error; + } + + done(); + }); +}); + gulp.task('compile:ts', 'Compile source files', function () { webpackConfig.plugins = [ new webpack.BannerPlugin(webpackBanner)