aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManolo Carrasco <manolo@apache.org>2015-10-01 07:52:14 +0200
committerManolo Carrasco <manolo@apache.org>2015-10-01 07:52:14 +0200
commit3d3811ffa554863c3b68b2f8dcb12d3c995afd8a (patch)
tree1f704db364f0bb27c75861ae5870ced37274dd37
parent64c9a94a470c47e1d4a457c2cb7814f1f824c34f (diff)
downloadvaadin-core-3d3811ffa554863c3b68b2f8dcb12d3c995afd8a.tar.gz
vaadin-core-3d3811ffa554863c3b68b2f8dcb12d3c995afd8a.zip
Add source src to meta info, so as website can figure out the github location of each file
-rw-r--r--bower.json2
-rw-r--r--package.json3
-rw-r--r--tasks/cdn.js1
-rw-r--r--tasks/docsite.js12
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]*?title:[\s\S]*?)[ \n]+-->.*\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]*?title:[\s\S]*?)[ \n]+-->.*\n([\s\S]*)/img,
+ '---\n$1\nsourceurl: ' + gh + '\n---\n{% raw %}\n$2\n{% endraw %}');
+ }
+ }))
.pipe(replace(/^.*<section>[\s\S]*?table-of-contents[\s\S]*?<\/section>.*\n/im, ''))
// Add ids to headers, so as site configures permalinks
.pipe(replace(/<h(\d+)>(.*)(<\/h\d+>)/img, function($0, $1, $2, $3){