From 0f671746ebaa0ec2aa4857c891ea5c6ce3675eae Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Tue, 29 Sep 2015 07:49:29 +0200 Subject: Adding tasks to prepare demos for the doc site --- tasks/cdn.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tasks/cdn.js b/tasks/cdn.js index fe48cec..7a8ebba 100644 --- a/tasks/cdn.js +++ b/tasks/cdn.js @@ -18,6 +18,7 @@ var host = config.cdnHost; var permalink = config.permalink; var stagingPath = stagingBasePath + '/' + version; var testPath = process.cwd() + '/' + stagingPath + '/test'; +var docPath = stagingPath + '/docsite'; gulp.task('clean:cdn', function() { fs.removeSync(stagingBasePath); @@ -87,6 +88,35 @@ gulp.task('cdn-test:install-dependencies', function() { }, [['web-component-tester#2.2.6']]); }); +gulp.task('cdn:docsite:bower_components', ['cdn:stage-bower_components'], function() { + gutil.log('Copying bower components from ' + stagingPath + ' to ' + docPath + '/bower_components'); + return gulp.src([stagingPath + '/**']) + .pipe(gulp.dest(docPath + '/bower_components')); +}); + +config.components.forEach(function (n) { + gulp.task('cdn:docsite:' + n, ['cdn:docsite:bower_components'], function(done) { + var componentDoc = docPath + '/' + n; + var componentOrg = stagingPath + '/' + n + '/demo/**'; + gutil.log('Generating site documentation from ' + componentOrg + ' into ' + componentDoc); + fs.mkdirsSync(componentDoc); + return gulp.src(componentOrg) + // Remove bad tags + .pipe(replace(/^.*<(!doctype|\/?html|\/?head|\/?body|meta|title).*>.*\n/img, '')) + // Uncomment metainfo + .pipe(replace(/^.*.*\n/img, '---\n$1\n---\n')) + // Remove Analytics + .pipe(replace(/^.*\s*?\n?/img, '')) + // Adjust location of the current component in bower_components (..) + .pipe(replace(/(src|href)=("|')\.\.(\/\w)/mg, '$1=$2../bower_components/' + n + '$3')) + // Adjust location of dependencies in bower_components (../..) + .pipe(replace(/(src|href)=("|')(.*?)\.\.\/\.\.\//mg, '$1=$2../bower_components/')) + // Remove the section with table-of-contents + .pipe(replace(/^.*
[\s\S]*?table-of-contents[\s\S]*?<\/section>.*\n/im, '')) + .pipe(gulp.dest(componentDoc)); + }); +}); + config.components.forEach(function (n) { gulp.task('cdn-test:stage:' + n, ['cdn-test:clean', 'cdn-test:install-dependencies'], function(done) { fs.mkdirsSync(testPath); -- cgit v1.2.3 From c532eac6b41b041f48194ad9afe7a5e37064efc9 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Tue, 29 Sep 2015 09:01:24 +0200 Subject: Adding ids to headers, so as site puts anchor links --- bower.json | 2 +- tasks/cdn.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bower.json b/bower.json index d385de0..f4b07a0 100644 --- a/bower.json +++ b/bower.json @@ -18,7 +18,7 @@ "**/tests" ], "dependencies": { - "vaadin-grid": "vaadin/vaadin-grid#0.9.0-beta2" + "vaadin-grid": "vaadin/vaadin-grid#master" }, "devDependencies": { "iron-doc-viewer": "polymerelements/iron-doc-viewer#~1.0.3", diff --git a/tasks/cdn.js b/tasks/cdn.js index 7a8ebba..73d7420 100644 --- a/tasks/cdn.js +++ b/tasks/cdn.js @@ -113,6 +113,12 @@ config.components.forEach(function (n) { .pipe(replace(/(src|href)=("|')(.*?)\.\.\/\.\.\//mg, '$1=$2../bower_components/')) // Remove the section with table-of-contents .pipe(replace(/^.*
[\s\S]*?table-of-contents[\s\S]*?<\/section>.*\n/im, '')) + // Add ids to headers, so as site configures permalinks + .pipe(replace(/(.*)(<\/h\d+>)/img, function($0, $1, $2, $3){ + var id = $2.trim().toLowerCase().replace(/[^\w]+/g,'_'); + return '' + $2 + $3; + })) + .pipe(gulp.dest(componentDoc)); }); }); -- cgit v1.2.3 From 85404f44f7e5c524b7edb86d2b5bbb4300bb6424 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Wed, 30 Sep 2015 08:18:21 +0200 Subject: Uploading docsite as a .zip file. Group all docsite related tasks in one file --- tasks/cdn.js | 35 ----------------------- tasks/docsite.js | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 35 deletions(-) create mode 100644 tasks/docsite.js diff --git a/tasks/cdn.js b/tasks/cdn.js index 73d7420..6816ebf 100644 --- a/tasks/cdn.js +++ b/tasks/cdn.js @@ -88,41 +88,6 @@ gulp.task('cdn-test:install-dependencies', function() { }, [['web-component-tester#2.2.6']]); }); -gulp.task('cdn:docsite:bower_components', ['cdn:stage-bower_components'], function() { - gutil.log('Copying bower components from ' + stagingPath + ' to ' + docPath + '/bower_components'); - return gulp.src([stagingPath + '/**']) - .pipe(gulp.dest(docPath + '/bower_components')); -}); - -config.components.forEach(function (n) { - gulp.task('cdn:docsite:' + n, ['cdn:docsite:bower_components'], function(done) { - var componentDoc = docPath + '/' + n; - var componentOrg = stagingPath + '/' + n + '/demo/**'; - gutil.log('Generating site documentation from ' + componentOrg + ' into ' + componentDoc); - fs.mkdirsSync(componentDoc); - return gulp.src(componentOrg) - // Remove bad tags - .pipe(replace(/^.*<(!doctype|\/?html|\/?head|\/?body|meta|title).*>.*\n/img, '')) - // Uncomment metainfo - .pipe(replace(/^.*.*\n/img, '---\n$1\n---\n')) - // Remove Analytics - .pipe(replace(/^.*\s*?\n?/img, '')) - // Adjust location of the current component in bower_components (..) - .pipe(replace(/(src|href)=("|')\.\.(\/\w)/mg, '$1=$2../bower_components/' + n + '$3')) - // Adjust location of dependencies in bower_components (../..) - .pipe(replace(/(src|href)=("|')(.*?)\.\.\/\.\.\//mg, '$1=$2../bower_components/')) - // Remove the section with table-of-contents - .pipe(replace(/^.*
[\s\S]*?table-of-contents[\s\S]*?<\/section>.*\n/im, '')) - // Add ids to headers, so as site configures permalinks - .pipe(replace(/(.*)(<\/h\d+>)/img, function($0, $1, $2, $3){ - var id = $2.trim().toLowerCase().replace(/[^\w]+/g,'_'); - return '' + $2 + $3; - })) - - .pipe(gulp.dest(componentDoc)); - }); -}); - config.components.forEach(function (n) { gulp.task('cdn-test:stage:' + n, ['cdn-test:clean', 'cdn-test:install-dependencies'], function(done) { fs.mkdirsSync(testPath); diff --git a/tasks/docsite.js b/tasks/docsite.js new file mode 100644 index 0000000..e8bee7d --- /dev/null +++ b/tasks/docsite.js @@ -0,0 +1,87 @@ +var bower = require('gulp-bower'); +var config = require('./config'); +var common = require('./common'); +var gulp = require('gulp'); +var fs = require('fs-extra'); +var replace = require('gulp-replace'); +var rsync = require('gulp-rsync'); +var gutil = require('gulp-util'); +var zip = require('gulp-zip'); +var args = require('yargs').argv; + + +var stagingBasePath = config.paths.staging.cdn; +var docPath = config.paths.staging.doc; +var version = config.version; +var host = config.cdnHost; +var permalink = config.permalink; +var stagingPath = stagingBasePath + '/' + version; + +gulp.task('cdn:docsite:bower_components', ['cdn:stage-bower_components'], function() { + gutil.log('Copying bower components from ' + stagingPath + ' to ' + docPath + '/bower_components'); + return gulp.src([stagingPath + '/**']) + .pipe(gulp.dest(docPath + '/bower_components')); +}); + +var doctasks = []; +config.components.forEach(function (n) { + var task = 'cdn:docsite:' + n; + doctasks.push(task); + gulp.task(task, ['cdn:docsite:bower_components'], function(done) { + var componentDoc = docPath + '/' + n; + var componentOrg = stagingPath + '/' + n + '/demo/**'; + gutil.log('Generating site documentation from ' + componentOrg + ' into ' + componentDoc); + fs.mkdirsSync(componentDoc); + return gulp.src(componentOrg) + // Remove bad tags + .pipe(replace(/^.*<(!doctype|\/?html|\/?head|\/?body|meta|title).*>.*\n/img, '')) + // Uncomment metainfo + .pipe(replace(/^.*.*\n/img, '---\n$1\n---\n')) + // Remove Analytics + .pipe(replace(/^.*\s*?\n?/img, '')) + // Adjust location of the current component in bower_components (..) + .pipe(replace(/(src|href)=("|')\.\.(\/\w)/mg, '$1=$2../bower_components/' + n + '$3')) + // Adjust location of dependencies in bower_components (../..) + .pipe(replace(/(src|href)=("|')(.*?)\.\.\/\.\.\//mg, '$1=$2../bower_components/')) + // Remove the section with table-of-contents + .pipe(replace(/^.*
[\s\S]*?table-of-contents[\s\S]*?<\/section>.*\n/im, '')) + // Add ids to headers, so as site configures permalinks + .pipe(replace(/(.*)(<\/h\d+>)/img, function($0, $1, $2, $3){ + var id = $2.trim().toLowerCase().replace(/[^\w]+/g,'_'); + return '' + $2 + $3; + })) + + .pipe(gulp.dest(componentDoc)); + }); +}); + +gulp.task('cdn:docsite:zip', doctasks, function() { + var src = docPath + '/../**/*'; + var root = 'target'; + var file = 'docsite.zip'; + gutil.log("Creating docsite zip " + docPath + " -> " + root + '/' + file); + return gulp.src(src) + .pipe(zip(file)) + .pipe(gulp.dest(root)); +}); + +gulp.task('cdn:docsite:upload', ['cdn:docsite:zip'], function(done) { + common.checkArguments(['cdnUsername', 'cdnDestination']); + var root = 'target'; + var file = 'docsite.zip'; + + gutil.log('Uploading docsite (scp): ' + root + '/' + file + ' -> ' + args.cdnUsername + '@' + host + ':' + args.cdnDestination + version); + + require('scp2').scp(root + '/' + file, { + host: host, + username: args.cdnUsername, + privateKey: config.paths.privateKey(), + path: args.cdnDestination + version + }, function(err) { + done(err); + }) +}); + +gulp.task('cdn:docsite', ['cdn:docsite:upload']); + + -- cgit v1.2.3 From 64c9a94a470c47e1d4a457c2cb7814f1f824c34f Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Wed, 30 Sep 2015 11:00:48 +0200 Subject: Do not process -embed files. Enclose files in {%raw%} annotations --- tasks/docsite.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tasks/docsite.js b/tasks/docsite.js index e8bee7d..7e08169 100644 --- a/tasks/docsite.js +++ b/tasks/docsite.js @@ -8,7 +8,7 @@ var rsync = require('gulp-rsync'); var gutil = require('gulp-util'); var zip = require('gulp-zip'); var args = require('yargs').argv; - +var addsrc = require('gulp-add-src'); var stagingBasePath = config.paths.staging.cdn; var docPath = config.paths.staging.doc; @@ -32,17 +32,11 @@ config.components.forEach(function (n) { var componentOrg = stagingPath + '/' + n + '/demo/**'; gutil.log('Generating site documentation from ' + componentOrg + ' into ' + componentDoc); fs.mkdirsSync(componentDoc); - return gulp.src(componentOrg) + return gulp.src([componentOrg, '!**/*-embed.html']) // Remove bad tags .pipe(replace(/^.*<(!doctype|\/?html|\/?head|\/?body|meta|title).*>.*\n/img, '')) - // Uncomment metainfo - .pipe(replace(/^.*.*\n/img, '---\n$1\n---\n')) - // Remove Analytics - .pipe(replace(/^.*\s*?\n?/img, '')) - // Adjust location of the current component in bower_components (..) - .pipe(replace(/(src|href)=("|')\.\.(\/\w)/mg, '$1=$2../bower_components/' + n + '$3')) - // Adjust location of dependencies in bower_components (../..) - .pipe(replace(/(src|href)=("|')(.*?)\.\.\/\.\.\//mg, '$1=$2../bower_components/')) + // Uncomment metainfo, and enclose all the example in {% raw %} ... {% endraw %} to avoid liquid conflicts + .pipe(replace(/^.*.*\n([\s\S]*)/img, '---\n$1\n---\n{% raw %}\n$2\n{% endraw %}')) // Remove the section with table-of-contents .pipe(replace(/^.*
[\s\S]*?table-of-contents[\s\S]*?<\/section>.*\n/im, '')) // Add ids to headers, so as site configures permalinks @@ -50,6 +44,14 @@ config.components.forEach(function (n) { var id = $2.trim().toLowerCase().replace(/[^\w]+/g,'_'); return '' + $2 + $3; })) + // embed files are displayed as iframe, we don't remove above fragments like body + .pipe(addsrc(componentOrg + '/*-embed.html')) + // Remove Analytics + .pipe(replace(/^.*\s*?\n?/img, '')) + // Adjust location of the current component in bower_components (..) + .pipe(replace(/(src|href)=("|')\.\.(\/\w)/mg, '$1=$2../bower_components/' + n + '$3')) + // Adjust location of dependencies in bower_components (../..) + .pipe(replace(/(src|href)=("|')(.*?)\.\.\/\.\.\//mg, '$1=$2../bower_components/')) .pipe(gulp.dest(componentDoc)); }); -- cgit v1.2.3 From 3d3811ffa554863c3b68b2f8dcb12d3c995afd8a Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Thu, 1 Oct 2015 07:52:14 +0200 Subject: Add source src to meta info, so as website can figure out the github location of each file --- bower.json | 2 +- package.json | 3 +-- tasks/cdn.js | 1 - tasks/docsite.js | 12 ++++++++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bower.json b/bower.json index f4b07a0..d385de0 100644 --- a/bower.json +++ b/bower.json @@ -18,7 +18,7 @@ "**/tests" ], "dependencies": { - "vaadin-grid": "vaadin/vaadin-grid#master" + "vaadin-grid": "vaadin/vaadin-grid#0.9.0-beta2" }, "devDependencies": { "iron-doc-viewer": "polymerelements/iron-doc-viewer#~1.0.3", diff --git a/package.json b/package.json index 6de4edd..682742a 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,8 @@ "gulp-util": "latest", "web-component-tester": "3.3.10", "yargs": "latest", - "gulp-git": "latest", + "gulp-modify": "^0.1.1", "gulp-add-src": "latest" - }, "devDependencies": { "chalk": "latest", diff --git a/tasks/cdn.js b/tasks/cdn.js index 6816ebf..fe48cec 100644 --- a/tasks/cdn.js +++ b/tasks/cdn.js @@ -18,7 +18,6 @@ var host = config.cdnHost; var permalink = config.permalink; var stagingPath = stagingBasePath + '/' + version; var testPath = process.cwd() + '/' + stagingPath + '/test'; -var docPath = stagingPath + '/docsite'; gulp.task('clean:cdn', function() { fs.removeSync(stagingBasePath); diff --git a/tasks/docsite.js b/tasks/docsite.js index 7e08169..c31683c 100644 --- a/tasks/docsite.js +++ b/tasks/docsite.js @@ -16,6 +16,7 @@ var version = config.version; var host = config.cdnHost; var permalink = config.permalink; var stagingPath = stagingBasePath + '/' + version; +var modify = require('gulp-modify'); gulp.task('cdn:docsite:bower_components', ['cdn:stage-bower_components'], function() { gutil.log('Copying bower components from ' + stagingPath + ' to ' + docPath + '/bower_components'); @@ -36,8 +37,15 @@ config.components.forEach(function (n) { // Remove bad tags .pipe(replace(/^.*<(!doctype|\/?html|\/?head|\/?body|meta|title).*>.*\n/img, '')) // Uncomment metainfo, and enclose all the example in {% raw %} ... {% endraw %} to avoid liquid conflicts - .pipe(replace(/^.*.*\n([\s\S]*)/img, '---\n$1\n---\n{% raw %}\n$2\n{% endraw %}')) - // Remove the section with table-of-contents + // We use gulp-modify instead of replace in order to handle the github url for this file + .pipe(modify({ + fileModifier: function(file, contents) { + var re = new RegExp(".*/" + n + "/"); + var gh = 'https://github.com/vaadin/' + n + '/edit/master/' + file.path.replace(re, ''); + return contents.replace(/^.*.*\n([\s\S]*)/img, + '---\n$1\nsourceurl: ' + gh + '\n---\n{% raw %}\n$2\n{% endraw %}'); + } + })) .pipe(replace(/^.*
[\s\S]*?table-of-contents[\s\S]*?<\/section>.*\n/im, '')) // Add ids to headers, so as site configures permalinks .pipe(replace(/(.*)(<\/h\d+>)/img, function($0, $1, $2, $3){ -- cgit v1.2.3 From 60e7b3c0273e7b332c3bcab84636f5be1b823089 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Thu, 1 Oct 2015 11:16:57 +0200 Subject: Remove _components root folder in zip file. Added clean --- tasks/docsite.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tasks/docsite.js b/tasks/docsite.js index c31683c..decede9 100644 --- a/tasks/docsite.js +++ b/tasks/docsite.js @@ -17,6 +17,14 @@ var host = config.cdnHost; var permalink = config.permalink; var stagingPath = stagingBasePath + '/' + version; var modify = require('gulp-modify'); +var rootZip = 'target/'; +var fileZip = 'docsite.zip' + + +gulp.task('cdn:docsite:clean', function() { + fs.removeSync(docPath); + fs.removeSync(rootZip + fileZip); +}); gulp.task('cdn:docsite:bower_components', ['cdn:stage-bower_components'], function() { gutil.log('Copying bower components from ' + stagingPath + ' to ' + docPath + '/bower_components'); @@ -66,23 +74,19 @@ config.components.forEach(function (n) { }); gulp.task('cdn:docsite:zip', doctasks, function() { - var src = docPath + '/../**/*'; - var root = 'target'; - var file = 'docsite.zip'; - gutil.log("Creating docsite zip " + docPath + " -> " + root + '/' + file); + var src = docPath + '/**/*'; + gutil.log("Creating docsite zip " + docPath + " -> " + rootZip + fileZip); return gulp.src(src) - .pipe(zip(file)) - .pipe(gulp.dest(root)); + .pipe(zip(fileZip)) + .pipe(gulp.dest(rootZip)); }); -gulp.task('cdn:docsite:upload', ['cdn:docsite:zip'], function(done) { +gulp.task('cdn:docsite:upload', ['cdn:docsite:clean', 'cdn:docsite:zip'], function(done) { common.checkArguments(['cdnUsername', 'cdnDestination']); - var root = 'target'; - var file = 'docsite.zip'; - gutil.log('Uploading docsite (scp): ' + root + '/' + file + ' -> ' + args.cdnUsername + '@' + host + ':' + args.cdnDestination + version); + gutil.log('Uploading docsite (scp): ' + rootZip + fileZip + ' -> ' + args.cdnUsername + '@' + host + ':' + args.cdnDestination + version); - require('scp2').scp(root + '/' + file, { + require('scp2').scp(rootZip + fileZip, { host: host, username: args.cdnUsername, privateKey: config.paths.privateKey(), -- cgit v1.2.3 From acdfc069443032f5f4c4aca18b9f0a33e8fec8d3 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Thu, 1 Oct 2015 14:24:14 +0200 Subject: Adding dummy index file, and doc folder thought for introduction etc --- doc/index.asciidoc | 1 + tasks/docsite.js | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 doc/index.asciidoc diff --git a/doc/index.asciidoc b/doc/index.asciidoc new file mode 100644 index 0000000..2dff096 --- /dev/null +++ b/doc/index.asciidoc @@ -0,0 +1 @@ +== Index \ No newline at end of file diff --git a/tasks/docsite.js b/tasks/docsite.js index decede9..771cbf7 100644 --- a/tasks/docsite.js +++ b/tasks/docsite.js @@ -20,7 +20,6 @@ var modify = require('gulp-modify'); var rootZip = 'target/'; var fileZip = 'docsite.zip' - gulp.task('cdn:docsite:clean', function() { fs.removeSync(docPath); fs.removeSync(rootZip + fileZip); @@ -32,16 +31,22 @@ gulp.task('cdn:docsite:bower_components', ['cdn:stage-bower_components'], functi .pipe(gulp.dest(docPath + '/bower_components')); }); -var doctasks = []; +gulp.task('cdn:docsite:components', function() { + return gulp.src('doc/*') + .pipe(gulp.dest(docPath)); +}); + +var doctasks = ['cdn:docsite:components']; config.components.forEach(function (n) { var task = 'cdn:docsite:' + n; doctasks.push(task); gulp.task(task, ['cdn:docsite:bower_components'], function(done) { - var componentDoc = docPath + '/' + n; - var componentOrg = stagingPath + '/' + n + '/demo/**'; - gutil.log('Generating site documentation from ' + componentOrg + ' into ' + componentDoc); - fs.mkdirsSync(componentDoc); - return gulp.src([componentOrg, '!**/*-embed.html']) + var componentDocsite = docPath + '/' + n; + var componentDemo = stagingPath + '/' + n + '/demo/**'; + + gutil.log('Generating site documentation from ' + componentDemo + ' into ' + componentDocsite); + fs.mkdirsSync(componentDocsite); + return gulp.src([componentDemo, '!**/*-embed.html']) // Remove bad tags .pipe(replace(/^.*<(!doctype|\/?html|\/?head|\/?body|meta|title).*>.*\n/img, '')) // Uncomment metainfo, and enclose all the example in {% raw %} ... {% endraw %} to avoid liquid conflicts @@ -61,7 +66,7 @@ config.components.forEach(function (n) { return '' + $2 + $3; })) // embed files are displayed as iframe, we don't remove above fragments like body - .pipe(addsrc(componentOrg + '/*-embed.html')) + .pipe(addsrc(componentDemo + '/*-embed.html')) // Remove Analytics .pipe(replace(/^.*\s*?\n?/img, '')) // Adjust location of the current component in bower_components (..) @@ -69,7 +74,7 @@ config.components.forEach(function (n) { // Adjust location of dependencies in bower_components (../..) .pipe(replace(/(src|href)=("|')(.*?)\.\.\/\.\.\//mg, '$1=$2../bower_components/')) - .pipe(gulp.dest(componentDoc)); + .pipe(gulp.dest(componentDocsite)); }); }); -- cgit v1.2.3 From f104a47f75c026176bbf25dccc1067c9f70c530c Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Tue, 6 Oct 2015 09:26:12 +0200 Subject: adding config parameter --- tasks/config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/config.js b/tasks/config.js index dc48921..4c53fd6 100644 --- a/tasks/config.js +++ b/tasks/config.js @@ -13,7 +13,8 @@ module.exports = { staging: { bower: 'target/bower', cdn: 'target/cdn', - zip: 'target/zip' + zip: 'target/zip', + doc: 'target/docsite' }, userhome: userhome, privateKey: function() { -- cgit v1.2.3 From 6374e028801bff91b738efb7252df02baf38e635 Mon Sep 17 00:00:00 2001 From: Tomi Virkki Date: Tue, 6 Oct 2015 10:56:06 +0300 Subject: Removing demo styles from common imports --- tasks/docsite.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/docsite.js b/tasks/docsite.js index 771cbf7..fe5546f 100644 --- a/tasks/docsite.js +++ b/tasks/docsite.js @@ -73,6 +73,8 @@ config.components.forEach(function (n) { .pipe(replace(/(src|href)=("|')\.\.(\/\w)/mg, '$1=$2../bower_components/' + n + '$3')) // Adjust location of dependencies in bower_components (../..) .pipe(replace(/(src|href)=("|')(.*?)\.\.\/\.\.\//mg, '$1=$2../bower_components/')) + // Remove references to demo.css file + .pipe(replace(/^.*demo.css.*\n/im, '')) .pipe(gulp.dest(componentDocsite)); }); -- cgit v1.2.3 From 83bc858374d4eef2946779f854b795e01fbe4eaf Mon Sep 17 00:00:00 2001 From: Tomi Virkki Date: Tue, 6 Oct 2015 11:02:44 +0300 Subject: Table of contents removed from common imports --- tasks/docsite.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/docsite.js b/tasks/docsite.js index fe5546f..f80f312 100644 --- a/tasks/docsite.js +++ b/tasks/docsite.js @@ -75,6 +75,8 @@ config.components.forEach(function (n) { .pipe(replace(/(src|href)=("|')(.*?)\.\.\/\.\.\//mg, '$1=$2../bower_components/')) // Remove references to demo.css file .pipe(replace(/^.*demo.css.*\n/im, '')) + // Remove table of contents + .pipe(replace(/^.*table-of-contents.html.*\n/im, '')) .pipe(gulp.dest(componentDocsite)); }); -- cgit v1.2.3 From db56a46d1aaa739dbeec4239220ac45a7d114dea Mon Sep 17 00:00:00 2001 From: Tomi Virkki Date: Tue, 6 Oct 2015 11:43:50 +0300 Subject: Added more specific regex for demo.css import --- tasks/docsite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/docsite.js b/tasks/docsite.js index f80f312..4f8be17 100644 --- a/tasks/docsite.js +++ b/tasks/docsite.js @@ -74,7 +74,7 @@ config.components.forEach(function (n) { // Adjust location of dependencies in bower_components (../..) .pipe(replace(/(src|href)=("|')(.*?)\.\.\/\.\.\//mg, '$1=$2../bower_components/')) // Remove references to demo.css file - .pipe(replace(/^.*demo.css.*\n/im, '')) + .pipe(replace(/^.* Date: Wed, 7 Oct 2015 07:42:24 +0200 Subject: Regexp for bowerComponents variable --- tasks/docsite.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/docsite.js b/tasks/docsite.js index 4f8be17..4440211 100644 --- a/tasks/docsite.js +++ b/tasks/docsite.js @@ -69,6 +69,8 @@ config.components.forEach(function (n) { .pipe(addsrc(componentDemo + '/*-embed.html')) // Remove Analytics .pipe(replace(/^.*\s*?\n?/img, '')) + // Adjust bowerComponents variable in common.html + .pipe(replace(/(bowerComponents *= *)'..\/..\/'/, "$1'../bower_components/'")) // Adjust location of the current component in bower_components (..) .pipe(replace(/(src|href)=("|')\.\.(\/\w)/mg, '$1=$2../bower_components/' + n + '$3')) // Adjust location of dependencies in bower_components (../..) @@ -77,7 +79,6 @@ config.components.forEach(function (n) { .pipe(replace(/^.* Date: Thu, 8 Oct 2015 08:07:16 +0200 Subject: Temporary fix until webcomponentsjs#180 is fixed --- tasks/docsite.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tasks/docsite.js b/tasks/docsite.js index 4440211..7c99868 100644 --- a/tasks/docsite.js +++ b/tasks/docsite.js @@ -28,6 +28,16 @@ gulp.task('cdn:docsite:clean', function() { gulp.task('cdn:docsite:bower_components', ['cdn:stage-bower_components'], function() { gutil.log('Copying bower components from ' + stagingPath + ' to ' + docPath + '/bower_components'); return gulp.src([stagingPath + '/**']) + // Temporary patch until #180 is fixed: + // https://github.com/webcomponents/webcomponentsjs/issues/180 + .pipe(modify({ + fileModifier: function(file, contents) { + if (/webcomponents-lite.*js/.test(file.path)) { + contents = contents.replace(/(if ?\()(\w+\.log)(\))/mg, '$1$2 && $2.split$3') + } + return contents; + } + })) .pipe(gulp.dest(docPath + '/bower_components')); }); -- cgit v1.2.3 From 1f3a3c90baeb7aab5097d4df9f9331c16d7520db Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Thu, 8 Oct 2015 10:25:54 +0200 Subject: Removing polyfill since its handled by site --- tasks/docsite.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/docsite.js b/tasks/docsite.js index 7c99868..bce91c8 100644 --- a/tasks/docsite.js +++ b/tasks/docsite.js @@ -75,7 +75,9 @@ config.components.forEach(function (n) { var id = $2.trim().toLowerCase().replace(/[^\w]+/g,'_'); return '' + $2 + $3; })) - // embed files are displayed as iframe, we don't remove above fragments like body + // Remove webcomponents polyfill since it's added at top of the site + .pipe(replace(/^.*\s*?\n?/img, '')) + // embed files are displayed as iframe, we don't remove above fragments like body or polyfill .pipe(addsrc(componentDemo + '/*-embed.html')) // Remove Analytics .pipe(replace(/^.*\s*?\n?/img, '')) -- cgit v1.2.3