]> source.dussan.org Git - vaadin-core.git/commitdiff
Adding ids to headers, so as site puts anchor links
authorManolo Carrasco <manolo@apache.org>
Tue, 29 Sep 2015 07:01:24 +0000 (09:01 +0200)
committerManolo Carrasco <manolo@apache.org>
Tue, 29 Sep 2015 07:07:47 +0000 (09:07 +0200)
bower.json
tasks/cdn.js

index d385de05a7c4c27f7b67c81e5a044b9eb5a56aed..f4b07a058ba928608c2268ca6ebc819b01e3a374 100644 (file)
@@ -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",
index 7a8ebba4b3f3b01b40fc97b85debff985f26f152..73d742089204c013f336775c4544525ae757338c 100644 (file)
@@ -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(/^.*<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){
+        var id = $2.trim().toLowerCase().replace(/[^\w]+/g,'_');
+        return '<h' + $1 + ' id="' + id + '">' + $2 + $3;
+      }))
+
       .pipe(gulp.dest(componentDoc));
   });
 });