summaryrefslogtreecommitdiffstats
path: root/gulpfile.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-07-13 11:33:26 +0200
committerwout <wout@impinc.co.uk>2014-07-13 11:33:26 +0200
commit03625df35f98f8e51993017f7a0ef23539741d6f (patch)
tree45ab5717a38b5adde0861c92674a1779c7472a56 /gulpfile.js
parente9a0d5f5d7074b1cb3d1bd5a00f6a602bd55f983 (diff)
downloadsvg.js-03625df35f98f8e51993017f7a0ef23539741d6f.tar.gz
svg.js-03625df35f98f8e51993017f7a0ef23539741d6f.zip
Added documentation builder
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/gulpfile.js b/gulpfile.js
index 99c27d7..23efdd0 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -6,6 +6,8 @@ var rimraf = require('gulp-rimraf')
var size = require('gulp-size')
var uglify = require('gulp-uglify')
var wrapper = require('gulp-wrapper')
+var request = require('request')
+var fs = require('fs')
var pkg = require('./package.json')
@@ -123,4 +125,29 @@ gulp.task('minify', ['unify'], function() {
}, 1000)
})
+/**
+ ‎* rebuild documentation using documentup
+ */
+
+gulp.task('docs', function() {
+ fs.readFile('README.md', 'utf8', function (err, data) {
+ request.post(
+ 'http://documentup.com/compiled'
+ , { form: { content: data, name: 'SVG.js', theme: 'v1' } }
+ , function (error, response, body) {
+ // Replace stylesheet
+ body = body.replace('//documentup.com/stylesheets/themes/v1.css', 'svgjs.css')
+
+ // Write file
+ fs.writeFile('docs/index.html', body, function(err) {})
+ }
+ )
+ })
+})
+
gulp.task('default', ['clean', 'unify', 'minify'], function() {})
+
+
+
+
+