]> source.dussan.org Git - vaadin-core.git/commitdiff
Add source src to meta info, so as website can figure out the github location of...
authorManolo Carrasco <manolo@apache.org>
Thu, 1 Oct 2015 05:52:14 +0000 (07:52 +0200)
committerManolo Carrasco <manolo@apache.org>
Thu, 1 Oct 2015 05:52:14 +0000 (07:52 +0200)
bower.json
package.json
tasks/cdn.js
tasks/docsite.js

index f4b07a058ba928608c2268ca6ebc819b01e3a374..d385de05a7c4c27f7b67c81e5a044b9eb5a56aed 100644 (file)
@@ -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",
index 6de4edd47c8d192709307ff4e373e15a74ce386c..682742aabb249d88e9eb4147b6c76e064fb9db0e 100644 (file)
@@ -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",
index 6816ebf72abf8f05c552e6e5c76f441e8d234be7..fe48cec15bc1afe90a30951f596d970c98ce5ac8 100644 (file)
@@ -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);
index 7e08169970f772b06d7c80a66ec9488996cbb730..c31683c3022f76b9acde3ec8ac67be2e406eea84 100644 (file)
@@ -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){