diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-03-29 16:29:27 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-03-29 16:29:27 +0200 |
commit | 748702c29ac00df5bfc4090dc3fa1b3a9e65da70 (patch) | |
tree | d16abbf3d39332b435c4eaa630cf3ffcccd68640 | |
parent | 3e7504156ac9e2fbef434e109306699ee87ddc9d (diff) | |
download | jquery-ui-748702c29ac00df5bfc4090dc3fa1b3a9e65da70.tar.gz jquery-ui-748702c29ac00df5bfc4090dc3fa1b3a9e65da70.zip |
Build/grunt: Add download_docs task for 1.8
-rw-r--r-- | grunt.js | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -372,6 +372,43 @@ grunt.registerMultiTask( "md5", "Create list of md5 hashes for CDN uploads", fun grunt.log.writeln( "Wrote " + this.file.dest + " with " + hashes.length + " hashes" ); }); +// only needed for 1.8 +grunt.registerTask( "download_docs", function() { + function capitalize(value) { + return value[0].toUpperCase() + value.slice(1); + } + // should be grunt.config("pkg.version")? + var version = "1.8"; + var docsDir = "dist/docs"; + var files = "draggable droppable resizable selectable sortable accordion autocomplete button datepicker dialog progressbar slider tabs position" + .split(" ").map(function(widget) { + return { + url: "http://docs.jquery.com/action/render/UI/API/" + version + "/" + capitalize(widget), + dest: docsDir + '/' + widget + '.html' + }; + }); + files = files.concat("animate addClass effect hide removeClass show switchClass toggle toggleClass".split(" ").map(function(widget) { + return { + url: "http://docs.jquery.com/action/render/UI/Effects/" + widget, + dest: docsDir + '/' + widget + '.html' + }; + })); + files = files.concat("Blind Clip Drop Explode Fade Fold Puff Slide Scale Bounce Highlight Pulsate Shake Size Transfer".split(" ").map(function(widget) { + return { + url: "http://docs.jquery.com/action/render/UI/Effects/" + widget, + dest: docsDir + '/effect-' + widget.toLowerCase() + '.html' + }; + })); + var fs = require( "fs" ); + var request = require( "request" ); + grunt.file.mkdir( "dist/docs" ); + grunt.utils.async.forEach( files, function( file, done ) { + var out = fs.createWriteStream( file.dest ); + out.on( "close", done ); + request( file.url ).pipe( out ); + }, this.async() ); +}); + grunt.registerTask( "download_themes", function() { // var AdmZip = require('adm-zip'); var fs = require( "fs" ); |