-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: Add documentation generation now that TypeDoc has been updated
- Loading branch information
1 parent
b2f9986
commit 9691d88
Showing
4 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
var gulp = require('gulp'), | ||
git = require('gulp-git'), | ||
typedoc = require('gulp-typedoc'), | ||
runSequence = require('run-sequence'), | ||
fs = require('fs'); | ||
|
||
var paths = require('./paths'); | ||
|
||
gulp.task('doc', function() { | ||
return runSequence('doc-build', 'doc-publish'); | ||
}); | ||
|
||
gulp.task('doc-build', function() { | ||
return runSequence('doc-checkout', 'doc-compile', ['doc-submodule', 'doc-attributes']); | ||
}); | ||
|
||
gulp.task('doc-checkout', function(cb) { | ||
return git.checkout('gh-pages', { cwd: 'doc', quiet: true }, cb); | ||
}); | ||
|
||
gulp.task('doc-submodule', function(cb) { | ||
fs.writeFile('doc/.git', 'gitdir: ../.git/modules/doc', cb); | ||
}); | ||
|
||
gulp.task('doc-attributes', function(cb) { | ||
fs.writeFile('doc/.gitattributes', '* text=auto', cb); | ||
}); | ||
|
||
gulp.task('doc-publish', function (cb) { | ||
setTimeout(function () { | ||
git.exec({ args: 'diff-files --quiet', quiet: true, cwd: 'doc' }, function(err) { | ||
if(err && err.code === 1) runSequence('doc-commit', 'doc-update-ref', 'doc-push', cb); | ||
else cb(); | ||
}); | ||
}, 5000); | ||
}); | ||
|
||
gulp.task('doc-commit', function() { | ||
return gulp.src('**', { cwd: 'doc' }) | ||
.pipe(git.commit('Updated documentation', { cwd: 'doc' })); | ||
}); | ||
|
||
gulp.task('doc-update-ref', function() { | ||
return gulp.src('.') | ||
.pipe(git.commit('Updated documentation')); | ||
}); | ||
|
||
gulp.task('doc-push', function(cb) { | ||
git.push('origin', 'gh-pages', { cwd: 'doc' }, cb); | ||
}); | ||
|
||
gulp.task('doc-compile', function() { | ||
return gulp.src(paths.docSourceFiles).pipe(typedoc({ | ||
module: 'commonjs', | ||
target: 'es5', | ||
mode: 'file', | ||
entryPoint: 'iridium', | ||
|
||
out: './doc', | ||
|
||
name: "Iridium", | ||
plugin: ['decorator'], | ||
ignoreCompilerErrors: true | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters