aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManolo Carrasco <manolo@apache.org>2015-09-29 09:01:24 +0200
committerManolo Carrasco <manolo@apache.org>2015-09-29 09:07:47 +0200
commitc532eac6b41b041f48194ad9afe7a5e37064efc9 (patch)
treeb5601a30fd4e0fe9c5ca7216b589f4028bdaabaf
parent0f671746ebaa0ec2aa4857c891ea5c6ce3675eae (diff)
downloadvaadin-core-c532eac6b41b041f48194ad9afe7a5e37064efc9.tar.gz
vaadin-core-c532eac6b41b041f48194ad9afe7a5e37064efc9.zip
Adding ids to headers, so as site puts anchor links
-rw-r--r--bower.json2
-rw-r--r--tasks/cdn.js6
2 files changed, 7 insertions, 1 deletions
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(/^.*<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));
});
});